Skip to content

Commit

Permalink
fixed autoaiming.
Browse files Browse the repository at this point in the history
The WW2GI pistol check was completely wrong. :(
  • Loading branch information
coelckers committed Dec 30, 2023
1 parent d352f56 commit 9315c8b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/games/duke/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,11 @@ DDukeActor* aim(DDukeActor* actor, int abase, bool force, bool* b)
auto* plr = getPlayer(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 (!ww2gipistol && (autoaim || otherpistol))
if (plr->curr_weapon == PISTOL_WEAPON)
{
if (isWW2GI()) return nullptr; // WW2GI's pistol never autoaims.
double vel = 1024, zvel = 0;
setFreeAimVelocity(vel, zvel, plr->getPitchWithView(), 16.);

Expand Down

0 comments on commit 9315c8b

Please sign in to comment.