From e0de0893a9684d2e9a2f093fa81c4dacf25c20d2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2023 23:54:43 +0200 Subject: [PATCH] - autoaim must never apply to WW2GI's pistol. --- source/games/duke/src/player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 298a1931c..e28851f66 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -206,9 +206,12 @@ DDukeActor* aim(DDukeActor* actor, int abase, bool force, bool* b) auto* plr = &ps[actor->PlayerIndex()]; int autoaim = force? 1 : Autoaim(actor->PlayerIndex()); + bool ww2gipistol = (plr->curr_weapon == PISTOL_WEAPON && isWW2GI()); + bool otherpistol = (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI()); + // 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 (!ww2gipistol && (autoaim || otherpistol)) { double vel = 1024, zvel = 0; setFreeAimVelocity(vel, zvel, plr->Angles.getPitchWithView(), 16.);