mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 03:22:35 +00:00
Merge branch 'respawn-fuck' into 'master'
Order-of-operations bugs for finish line / respawning Closes #954 See merge request KartKrew/Kart!1946
This commit is contained in:
commit
9636be99e2
3 changed files with 14 additions and 9 deletions
|
|
@ -9674,6 +9674,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
|
||||
|
|
|
|||
|
|
@ -197,8 +197,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)
|
||||
|
|
@ -341,12 +343,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1954,7 +1954,9 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
nump++;
|
||||
}
|
||||
|
||||
player->cheatchecknum = 0;
|
||||
player->laps++;
|
||||
K_UpdateAllPlayerPositions();
|
||||
|
||||
if (G_TimeAttackStart() && !linecrossed)
|
||||
{
|
||||
|
|
@ -1987,8 +1989,6 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
if (netgame && player->laps > numlaps)
|
||||
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
||||
|
||||
player->cheatchecknum = 0;
|
||||
|
||||
if (gametyperules & GTR_SPECIALSTART)
|
||||
{
|
||||
if (player->laps > numlaps)
|
||||
|
|
@ -2182,6 +2182,7 @@ static void K_HandleLapDecrement(player_t *player)
|
|||
{
|
||||
player->cheatchecknum = numcheatchecks;
|
||||
player->laps--;
|
||||
K_UpdateAllPlayerPositions();
|
||||
curlap = UINT32_MAX;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue