Ring Shooter: do not go backward, go straight to respawn waypoint

There was a bug here that could drop you at the finish
line waypoint. That could be bad because of sight check
discrepancy (see 99656765e).
This commit is contained in:
James R 2024-03-16 17:33:40 -07:00
parent 99656765e5
commit eed5ada28c

View file

@ -203,15 +203,7 @@ void K_DoIngameRespawn(player_t *player)
{ {
if (player->respawn.fromRingShooter == true) if (player->respawn.fromRingShooter == true)
{ {
waypoint_t *finishline = K_GetFinishLineWaypoint();
waypoint_t *prevWP = player->respawn.wp; waypoint_t *prevWP = player->respawn.wp;
// 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)
break;
}
const UINT32 dist = (player->airtime * 48); const UINT32 dist = (player->airtime * 48);
player->respawn.distanceleft = (dist * mapobjectscale) / FRACUNIT; player->respawn.distanceleft = (dist * mapobjectscale) / FRACUNIT;