Skip to content

Commit

Permalink
Fix long standing jump lag & movement bug based on FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowsAdi committed Apr 29, 2022
1 parent 0a6e454 commit bb4cbae
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions regamedll/pm_shared/pm_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2771,6 +2771,52 @@ void PM_CheckParameters()
}
}

#if defined REGAMEDLL_FIXES
void PM_ReduceTimers()
{
float frame_msec = 1000.0f * pmove->frametime;

if (pmove->flTimeStepSound > 0.0)
{
pmove->flTimeStepSound -= frame_msec;

if (pmove->flTimeStepSound < 0)
{
pmove->flTimeStepSound = 0.0;
}
}

if (pmove->flDuckTime > 0.0)
{
pmove->flDuckTime -= frame_msec;

if (pmove->flDuckTime < 0)
{
pmove->flDuckTime = 0.0;
}
}

if (pmove->flSwimTime > 0.0)
{
pmove->flSwimTime -= frame_msec;

if (pmove->flSwimTime < 0)
{
pmove->flSwimTime = 0.0;
}
}

if (pmove->fuser2 > 0.0)
{
pmove->fuser2 -= frame_msec;

if (pmove->fuser2 < 0.0)
{
pmove->fuser2 = 0.0;
}
}
}
#else
void PM_ReduceTimers()
{
if (pmove->flTimeStepSound > 0)
Expand Down Expand Up @@ -2813,6 +2859,7 @@ void PM_ReduceTimers()
}
}
}
#endif

qboolean PM_ShouldDoSpectMode()
{
Expand Down

0 comments on commit bb4cbae

Please sign in to comment.