mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Lap cheat prevention: always reset lap to safelap when timer is reset
- This was done implicitly by respawn
- However, it is sometimes possible to:
- Cross the finish line forward
- Gain a lap
- Lap cheat prevention activates afterward
- Drive backward over the finish line again
- Must still have the lap cheat prevention timer
running
- Do not lose a lap
- Timer resets once you're behind the line
- Now:
- You are behind the finish line
- Lap cheat prevention is not active
- You still have the lap gained from crossing the
finish line the first time
- To fix this:
- Reset your current lap to your lap safe when the timer
resets
- Safelap does not change while lap cheat prevention is
active
- Basically I am fixing an oversight in the lap cheat
prevention system, because the timer, safelap and your
current waypoints are all tied together already
- It's just the current lap that was not being tied
together with the rest of it
This commit is contained in:
parent
748ef17cf7
commit
cee4c6106b
1 changed files with 6 additions and 1 deletions
|
|
@ -10029,9 +10029,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue