Skip to content

Commit

Permalink
Fixed a bug in spectator move with no apply friction when stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Aug 5, 2024
1 parent a47d558 commit 11638cb
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions regamedll/pm_shared/pm_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1711,20 +1711,24 @@ void PM_SpectatorMove()
currentspeed = DotProduct(pmove->velocity, wishdir);

addspeed = wishspeed - currentspeed;

#ifdef REGAMEDLL_FIXES
if (addspeed <= 0)
{
return;
}

accelspeed = pmove->movevars->accelerate * pmove->frametime * wishspeed;
if (accelspeed > addspeed)
#else
if (addspeed > 0)
#endif
{
accelspeed = addspeed;
}
accelspeed = pmove->movevars->accelerate * pmove->frametime * wishspeed;
if (accelspeed > addspeed)
{
accelspeed = addspeed;
}

for (i = 0; i < 3; i++)
{
pmove->velocity[i] += accelspeed * wishdir[i];
for (i = 0; i < 3; i++)
{
pmove->velocity[i] += accelspeed * wishdir[i];
}
}

// move
Expand Down

0 comments on commit 11638cb

Please sign in to comment.