mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Respawn: move lastsafelap check to K_UpdateDistanceFromFinishLine
- Order of operations; it is possible in specific circumstances to respawn (K_DoIngameRespawn) before the lap increments - In this case, the lap would be reset to lastsafelap and then incremented afterward - This would allow someone to skip the first lap - It was possible to do this in many maps where the finish line intersects a respawn line, by driving into the corner where the lines meet
This commit is contained in:
parent
1919471ae4
commit
a03cc5489c
2 changed files with 8 additions and 6 deletions
|
|
@ -9669,6 +9669,14 @@ void K_UpdateDistanceFromFinishLine(player_t *const player)
|
|||
waypoint_t *finishline = K_GetFinishLineWaypoint();
|
||||
waypoint_t *nextwaypoint = NULL;
|
||||
|
||||
if (player->respawn.state == RESPAWNST_MOVE &&
|
||||
player->respawn.init == true &&
|
||||
player->lastsafelap < player->laps)
|
||||
{
|
||||
player->laps = player->lastsafelap;
|
||||
player->cheatchecknum = player->lastsafecheatcheck;
|
||||
}
|
||||
|
||||
if (player->spectator)
|
||||
{
|
||||
// Don't update waypoints while spectating
|
||||
|
|
|
|||
|
|
@ -318,12 +318,6 @@ void K_DoIngameRespawn(player_t *player)
|
|||
player->respawn.fast = true;
|
||||
player->respawn.returnspeed = 0;
|
||||
|
||||
if (player->lastsafelap < player->laps)
|
||||
{
|
||||
player->laps = player->lastsafelap;
|
||||
player->cheatchecknum = player->lastsafecheatcheck;
|
||||
}
|
||||
|
||||
player->respawn.airtimer = player->airtime;
|
||||
player->respawn.truedeath = !!(player->pflags & PF_FAULT);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue