Correct to safelap instantly to prevent finish distance spike

This commit is contained in:
AJ Martinez 2023-10-18 22:40:24 -07:00
parent f0d0a0f07b
commit 6f65d55009
3 changed files with 7 additions and 7 deletions

View file

@ -5244,11 +5244,12 @@ static void K_DrawWaypointDebugger(void)
if (netgame)
{
V_DrawString(8, 146, 0, va("Online griefing: [%u, %u]", stplyr->griefValue/TICRATE, stplyr->griefStrikes));
V_DrawString(8, 136, 0, va("Online griefing: [%u, %u]", stplyr->griefValue/TICRATE, stplyr->griefStrikes));
}
V_DrawString(8, 156, 0, va("Current Waypoint ID: %d", K_GetWaypointID(stplyr->currentwaypoint)));
V_DrawString(8, 166, 0, va("Next Waypoint ID: %d%s", K_GetWaypointID(stplyr->nextwaypoint), ((stplyr->pflags & PF_WRONGWAY) ? " (WRONG WAY)" : "")));
V_DrawString(8, 146, 0, va("Current Waypoint ID: %d", K_GetWaypointID(stplyr->currentwaypoint)));
V_DrawString(8, 156, 0, va("Next Waypoint ID: %d%s", K_GetWaypointID(stplyr->nextwaypoint), ((stplyr->pflags & PF_WRONGWAY) ? " (WRONG WAY)" : "")));
V_DrawString(8, 166, 0, va("Respawn Waypoint ID: %d", K_GetWaypointID(stplyr->respawn.wp)));
V_DrawString(8, 176, 0, va("Finishline Distance: %d", stplyr->distancetofinish));
if (numcheatchecks > 0)

View file

@ -289,6 +289,7 @@ void K_DoIngameRespawn(player_t *player)
player->respawn.init = true;
player->respawn.fast = true;
player->respawn.returnspeed = 0;
player->laps = player->lastsafelap;
player->respawn.airtimer = player->airtime;
player->respawn.truedeath = !!(player->pflags & PF_FAULT);
@ -403,12 +404,8 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
P_SetThingPosition(player->mo);
// We are no longer traveling from death location to 1st waypoint, so use standard timings
// (and reset their lap so they can't cross the finish the wrong way!)
if (player->respawn.fast)
{
player->respawn.fast = false;
player->laps = player->lastsafelap;
}
// At the first valid waypoint, permit extra player control options.
player->respawn.init = false;

View file

@ -2142,6 +2142,8 @@ static void K_HandleLapDecrement(player_t *player)
{
if (player)
{
if (player->respawn.state == RESPAWNST_MOVE)
return;
if ((player->cheatchecknum == 0) && (player->laps > 0))
{
player->cheatchecknum = numcheatchecks;