Merge branch 'fix-lap-cheat-edge-case' into 'master'

Lap cheat prevention: always reset lap to safelap when timer is reset

See merge request KartKrew/Kart!2069
This commit is contained in:
James R. 2024-03-11 09:38:42 +00:00
commit aa9f1246e8

View file

@ -10050,9 +10050,14 @@ static void K_UpdatePlayerWaypoints(player_t *const player)
else
{
// Reset the auto respawn timer if distance changes are back to normal.
if (player->bigwaypointgap <= AUTORESPAWN_THRESHOLD + 1)
if (player->bigwaypointgap && player->bigwaypointgap <= AUTORESPAWN_THRESHOLD + 1)
{
player->bigwaypointgap = 0;
// While the player was in the "bigwaypointgap" state, laps did not change from crossing finish lines.
// So reset the lap back to normal, in case they were able to get behind the line.
player->laps = player->lastsafelap;
player->cheatchecknum = player->lastsafecheatcheck;
}
}