# HG changeset patch # User Adam Kaminski # Date 1635775930 14400 # Mon Nov 01 10:12:10 2021 -0400 # Node ID f75b7b5309910dc4116b821eb95c7c52d1ee7fc8 # Parent 364628122873745c8b5dc95017687243615c750c SetDeadSpectator can now revive dead spectators while the game is waiting for players or in the countdown sequence. diff -r 364628122873 -r f75b7b530991 src/p_acs.cpp --- a/src/p_acs.cpp Mon Nov 01 00:54:10 2021 -0400 +++ b/src/p_acs.cpp Mon Nov 01 10:12:10 2021 -0400 @@ -7219,6 +7219,7 @@ { const ULONG ulPlayer = static_cast ( args[0] ); const bool bDeadSpectator = !!args[1]; + const GAMESTATE_e gamestate = GAMEMODE_GetState( ); // [BB] Clients are not allowed to change the status of players. if ( NETWORK_InClientMode() ) @@ -7228,8 +7229,11 @@ if ( ( GAMEMODE_GetCurrentFlags() & GMF_DEADSPECTATORS ) == false ) return 0; - // [AK] This should only work while the game is in progress. - if ( GAMEMODE_GetState( ) != GAMESTATE_INPROGRESS ) + // [AK] This should never work while the game is in the result sequence. We also + // shouldn't turn players into dead spectators if the game isn't in progress, + // but we can still revive any dead spectators that might exist while the game + // is waiting for players or in the countdown sequence. + if (( gamestate != GAMESTATE_INPROGRESS ) && ( gamestate == GAMESTATE_INRESULTSEQUENCE || bDeadSpectator )) return 0; if ( PLAYER_IsValidPlayer ( ulPlayer ) == false )