Time Attack ghosts: sync with level timer instead of when the player crosses the finish line

This commit is contained in:
James R 2024-01-30 17:27:34 -08:00
parent 3d10278bf2
commit 6123ac3c39
2 changed files with 6 additions and 4 deletions

View file

@ -1237,8 +1237,8 @@ void G_GhostTicker(void)
continue;
}
// Pause jhosts that cross until we cross ourself.
if (g->linecrossed && !linecrossed)
// Pause jhosts that cross until the timer starts.
if (g->linecrossed && leveltime < starttime)
continue;
readghosttic:
@ -1548,7 +1548,8 @@ skippedghosttic:
continue;
}
if (linecrossed && !g->linecrossed)
// If the timer started, skip ahead until the ghost starts too.
if (starttime <= leveltime && !g->linecrossed)
goto readghosttic;
p = g;

View file

@ -1961,7 +1961,8 @@ static void K_HandleLapIncrement(player_t *player)
linecrossed = leveltime;
if (starttime > leveltime) // Overlong starts shouldn't reset time on cross
starttime = leveltime;
demo_extradata[player-players] |= DXD_START;
if (demo.recording)
demo_extradata[player-players] |= DXD_START;
Music_Stop("position");
}