mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Prisons: fix exit conditions around spectating
Fixes player death not ending a Prisons round, bugged debug feature. Now, do it properly. Don't end the round if the last player spectates. This is more than a debug feature; in Free Play, it lets the player spectate and fly around if they want to, and even come back in, all without restarting the level.
This commit is contained in:
parent
9bbd850d74
commit
71f9b79e71
2 changed files with 13 additions and 6 deletions
|
|
@ -127,10 +127,7 @@ void K_CheckBumpers(void)
|
|||
{
|
||||
if (nobumpers > 0 && nobumpers >= numingame)
|
||||
{
|
||||
// TODO: this would make a great debug feature for release
|
||||
#ifndef DEVELOP
|
||||
P_DoAllPlayersExit(PF_NOCONTEST, false);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -142,9 +139,9 @@ void K_CheckBumpers(void)
|
|||
|
||||
if (numingame <= 1)
|
||||
{
|
||||
if ((gametyperules & GTR_PRISONS) && (K_CanChangeRules(true) == true))
|
||||
if ((gametyperules & GTR_PRISONS) && !battleprisons && (K_CanChangeRules(true) == true))
|
||||
{
|
||||
// Reset map to turn on battle capsules
|
||||
// Reset map to turn on battle prisons
|
||||
if (server)
|
||||
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1556,7 +1556,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
P_PlayDeathSound(target);
|
||||
}
|
||||
|
||||
if (K_Cooperative())
|
||||
// Prisons Free Play: don't eliminate P1 for
|
||||
// spectating. Because in Free Play, this player
|
||||
// can enter the game again, and these flags would
|
||||
// make them intangible.
|
||||
if (K_Cooperative() && !target->player->spectator)
|
||||
{
|
||||
target->player->pflags |= PF_ELIMINATED;
|
||||
|
||||
|
|
@ -2160,6 +2164,12 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
|
|||
player->pflags |= PF_ELIMINATED;
|
||||
}
|
||||
|
||||
if (type == DMG_SPECTATOR)
|
||||
{
|
||||
// Set it here so K_CheckBumpers knows about it later.
|
||||
player->spectator = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue