mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Reorganize P_DoPlayerExit
I tried to fix the GP ending weirdness a long time ago by recalculating all player positions at time of exit... and then K_IsPlayerLosing gets to a variable before the recalculation and a bunch of crap uses it and completely undoes anything this might've fixed. DON'T DO THAT!
This commit is contained in:
parent
e22ed7fd1c
commit
3b755b7153
2 changed files with 25 additions and 22 deletions
|
|
@ -845,7 +845,7 @@ void K_PlayerLoseLife(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->spectator || (player->exiting && !(player->pflags & PF_NOCONTEST)) || player->bot || player->lives <= 0 || (player->pflags & PF_LOSTLIFE))
|
if (player->spectator || player->bot || player->lives <= 0 || (player->pflags & PF_LOSTLIFE))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
45
src/p_user.c
45
src/p_user.c
|
|
@ -1270,9 +1270,6 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
||||||
|
|
||||||
player->pflags |= flags;
|
player->pflags |= flags;
|
||||||
|
|
||||||
const boolean losing = K_IsPlayerLosing(player);
|
|
||||||
const boolean specialout = (specialstageinfo.valid == true && losing == true);
|
|
||||||
|
|
||||||
if (P_IsLocalPlayer(player) && (!player->spectator && !demo.playback))
|
if (P_IsLocalPlayer(player) && (!player->spectator && !demo.playback))
|
||||||
{
|
{
|
||||||
legitimateexit = true;
|
legitimateexit = true;
|
||||||
|
|
@ -1280,6 +1277,30 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
||||||
gamedata->deferredconditioncheck = true;
|
gamedata->deferredconditioncheck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player->exiting = 1;
|
||||||
|
|
||||||
|
if (!player->spectator)
|
||||||
|
{
|
||||||
|
ClearFakePlayerSkin(player);
|
||||||
|
|
||||||
|
if ((gametyperules & GTR_CIRCUIT)) // Special Race-like handling
|
||||||
|
{
|
||||||
|
K_UpdateAllPlayerPositions();
|
||||||
|
|
||||||
|
if (P_CheckRacers() && !exitcountdown)
|
||||||
|
{
|
||||||
|
G_BeginLevelExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!exitcountdown) // All other gametypes
|
||||||
|
{
|
||||||
|
G_BeginLevelExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const boolean losing = K_IsPlayerLosing(player); // HEY!!!! Set it AFTER K_UpdateAllPlayerPositions!!!!
|
||||||
|
const boolean specialout = (specialstageinfo.valid == true && losing == true);
|
||||||
|
|
||||||
if (G_GametypeUsesLives() && losing)
|
if (G_GametypeUsesLives() && losing)
|
||||||
{
|
{
|
||||||
// Remove a life from the losing player
|
// Remove a life from the losing player
|
||||||
|
|
@ -1292,12 +1313,8 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
||||||
musiccountdown = MUSIC_COUNTDOWN_MAX;
|
musiccountdown = MUSIC_COUNTDOWN_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
player->exiting = 1;
|
|
||||||
|
|
||||||
if (!player->spectator)
|
if (!player->spectator)
|
||||||
{
|
{
|
||||||
ClearFakePlayerSkin(player);
|
|
||||||
|
|
||||||
if (!(gametyperules & GTR_SPHERES))
|
if (!(gametyperules & GTR_SPHERES))
|
||||||
{
|
{
|
||||||
player->hudrings = RINGTOTAL(player);
|
player->hudrings = RINGTOTAL(player);
|
||||||
|
|
@ -1320,20 +1337,6 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gametyperules & GTR_CIRCUIT)) // Special Race-like handling
|
|
||||||
{
|
|
||||||
K_UpdateAllPlayerPositions();
|
|
||||||
|
|
||||||
if (P_CheckRacers() && !exitcountdown)
|
|
||||||
{
|
|
||||||
G_BeginLevelExit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!exitcountdown) // All other gametypes
|
|
||||||
{
|
|
||||||
G_BeginLevelExit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (specialstageinfo.valid == true && losing == false && P_MobjWasRemoved(player->mo) == false)
|
if (specialstageinfo.valid == true && losing == false && P_MobjWasRemoved(player->mo) == false)
|
||||||
{
|
{
|
||||||
K_MakeObjectReappear(player->mo);
|
K_MakeObjectReappear(player->mo);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue