This is a fork of Zandronum for Mac Os (Silicon and Intel)
Revision | 31baef03f8e4e9d9bd6fd99902a779f9daf15b4e (tree) |
---|---|
Zeit | 2021-11-01 23:12:10 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
SetDeadSpectator can now revive dead spectators while the game is waiting for players or in the countdown sequence.
@@ -7219,6 +7219,7 @@ | ||
7219 | 7219 | { |
7220 | 7220 | const ULONG ulPlayer = static_cast<ULONG> ( args[0] ); |
7221 | 7221 | const bool bDeadSpectator = !!args[1]; |
7222 | + const GAMESTATE_e gamestate = GAMEMODE_GetState( ); | |
7222 | 7223 | |
7223 | 7224 | // [BB] Clients are not allowed to change the status of players. |
7224 | 7225 | if ( NETWORK_InClientMode() ) |
@@ -7228,8 +7229,11 @@ | ||
7228 | 7229 | if ( ( GAMEMODE_GetCurrentFlags() & GMF_DEADSPECTATORS ) == false ) |
7229 | 7230 | return 0; |
7230 | 7231 | |
7231 | - // [AK] This should only work while the game is in progress. | |
7232 | - if ( GAMEMODE_GetState( ) != GAMESTATE_INPROGRESS ) | |
7232 | + // [AK] This should never work while the game is in the result sequence. We also | |
7233 | + // shouldn't turn players into dead spectators if the game isn't in progress, | |
7234 | + // but we can still revive any dead spectators that might exist while the game | |
7235 | + // is waiting for players or in the countdown sequence. | |
7236 | + if (( gamestate != GAMESTATE_INPROGRESS ) && ( gamestate == GAMESTATE_INRESULTSEQUENCE || bDeadSpectator )) | |
7233 | 7237 | return 0; |
7234 | 7238 | |
7235 | 7239 | if ( PLAYER_IsValidPlayer ( ulPlayer ) == false ) |