From fa1e667140d64733e01e68cd8ee17acb0ed1049f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2023 22:49:07 +0200 Subject: [PATCH] - Duke/RR: Use the exact same trajectory for autoaiming and the actual attack hitscan for the pistol. These were not identical so the pistol was likely to miss small targets the autoaim acquired. This was particularly bad for Duke's ceiling turret and RR's mosquito. --- source/games/duke/src/player.cpp | 2 +- .../static/zscript/games/duke/actors/dukeweapons/hitscan.zs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index f79cadb2c..ab425265e 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -209,7 +209,7 @@ DDukeActor* aim(DDukeActor* actor, int abase, bool force) { // Some fudging to avoid aim randomization when autoaim is off. // This is a reimplementation of how it was solved in RedNukem. - if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI()) + if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI() && 0) { double vel = 1024, zvel = 0; setFreeAimVelocity(vel, zvel, plr->Angles.getPitchWithView(), 16.); diff --git a/wadsrc/static/zscript/games/duke/actors/dukeweapons/hitscan.zs b/wadsrc/static/zscript/games/duke/actors/dukeweapons/hitscan.zs index 600f2144c..6672c7619 100644 --- a/wadsrc/static/zscript/games/duke/actors/dukeweapons/hitscan.zs +++ b/wadsrc/static/zscript/games/duke/actors/dukeweapons/hitscan.zs @@ -48,9 +48,7 @@ extend class DukeActor let aimed = actor.aim(self, aimangle); if (aimed) { - double dal = ((aimed.scale.X * aimed.spriteHeight()) * 0.5) + aimed.sparkoffset; - double dist = (p.actor.pos.XY - aimed.pos.XY).Length(); - zvel = ((aimed.pos.Z - pos.Z - dal) * 16) / dist; + [vel, zvel] = Raze.setFreeAimVelocity(vel, zvel, p.getPitchWithView(), 16.); ang = (aimed.pos - pos).Angle(); }