Respawn: don't let Ring Shooter send you behind the finish line

Because lap decrement does not happen when respawning,
this would you skip a lap.
This commit is contained in:
James R 2024-02-23 22:54:32 -08:00
parent a03cc5489c
commit 0dd359ba5a

View file

@ -178,8 +178,10 @@ void K_DoIngameRespawn(player_t *player)
{
if (player->respawn.fromRingShooter == true)
{
waypoint_t *finishline = K_GetFinishLineWaypoint();
waypoint_t *prevWP = player->respawn.wp;
while (prevWP->numprevwaypoints > 0)
// Laps don't decrement while respawning, so don't cross behind the finish line
while (prevWP->numprevwaypoints > 0 && prevWP != finishline)
{
prevWP = prevWP->prevwaypoints[0];
if (K_GetWaypointIsSpawnpoint(prevWP) == true)