diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index cd91bb1e..98aad5f1 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -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...