mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-15 18:17:19 +00:00
Lose player life before P_CheckRacers on exit
Fixes KartKrew/Kart#1022 by ensuring the player has 0 lives by the time P_CheckRacers indirectly calls G_BeginLevelExit.
This commit is contained in:
parent
796e2b9517
commit
d3783dec11
1 changed files with 14 additions and 11 deletions
25
src/p_user.c
25
src/p_user.c
|
|
@ -1206,14 +1206,26 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
|||
|
||||
player->exiting = 1;
|
||||
|
||||
if (!player->spectator && (gametyperules & GTR_CIRCUIT)) // Special Race-like handling
|
||||
{
|
||||
K_UpdateAllPlayerPositions();
|
||||
}
|
||||
|
||||
const boolean losing = K_IsPlayerLosing(player); // HEY!!!! Set it AFTER K_UpdateAllPlayerPositions!!!!
|
||||
const boolean specialout = (specialstageinfo.valid == true && losing == true);
|
||||
|
||||
if (G_GametypeUsesLives() && losing)
|
||||
{
|
||||
// Remove a life from the losing player
|
||||
K_PlayerLoseLife(player);
|
||||
}
|
||||
|
||||
if (!player->spectator)
|
||||
{
|
||||
ClearFakePlayerSkin(player);
|
||||
|
||||
if ((gametyperules & GTR_CIRCUIT)) // Special Race-like handling
|
||||
{
|
||||
K_UpdateAllPlayerPositions();
|
||||
|
||||
if (P_CheckRacers() && !exitcountdown)
|
||||
{
|
||||
G_BeginLevelExit();
|
||||
|
|
@ -1225,17 +1237,8 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
|||
}
|
||||
}
|
||||
|
||||
const boolean losing = K_IsPlayerLosing(player); // HEY!!!! Set it AFTER K_UpdateAllPlayerPositions!!!!
|
||||
const boolean specialout = (specialstageinfo.valid == true && losing == true);
|
||||
|
||||
K_UpdatePowerLevelsFinalize(player, false);
|
||||
|
||||
if (G_GametypeUsesLives() && losing)
|
||||
{
|
||||
// Remove a life from the losing player
|
||||
K_PlayerLoseLife(player);
|
||||
}
|
||||
|
||||
if (P_IsLocalPlayer(player) && !specialout && musiccountdown == 0)
|
||||
{
|
||||
Music_Play("finish_silence");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue