Fix the on-ground 0.5s start-timer check from 89e97dfd3d

This commit is contained in:
rtldg 2025-07-23 23:06:24 +00:00
parent 309cdf3acf
commit 00feb624c2

View File

@ -2569,10 +2569,15 @@ bool CanStartTimer(int client, int track, bool skipGroundCheck)
if (skipGroundTimer) return true;
int halfSecOfTicks = RoundFloat(0.5 / GetTickInterval());
int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGround[client];
if (gI_FirstTouchedGround[client] > 0)
{
int halfSecOfTicks = RoundFloat(0.5 / GetTickInterval());
int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGround[client];
return onGroundTicks >= halfSecOfTicks;
return onGroundTicks >= halfSecOfTicks;
}
return false;
}
void StartTimer(int client, int track, bool skipGroundCheck)
@ -3672,6 +3677,11 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
}
}
if (!bOnGround)
{
gI_FirstTouchedGround[client] = 0;
}
// This can be bypassed by spamming +duck on CSS which causes `iGroundEntity` to be `-1` here...
// (e.g. an autobhop + velocity_limit style...)
// m_hGroundEntity changes from 0 -> -1 same tick which causes problems and I'm not sure what the best way / place to handle that is...