# HG changeset patch # User Adam Kaminski # Date 1635707568 14400 # Sun Oct 31 15:12:48 2021 -0400 # Node ID b032fe0d9ee5499ed22c32968017fbb8287c17a8 # Parent 366f5d10bc73521ba6d04d70cc411d898605d85b Eased up SetDeadSpectator so that it still works for game modes without unique states if waiting for players. diff -r 366f5d10bc73 -r b032fe0d9ee5 src/p_acs.cpp --- a/src/p_acs.cpp Sat Oct 30 13:16:29 2021 -0400 +++ b/src/p_acs.cpp Sun Oct 31 15:12:48 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,9 +7229,16 @@ if ( ( GAMEMODE_GetCurrentFlags() & GMF_DEADSPECTATORS ) == false ) return 0; - // [AK] This should only work while the game is in progress. - if ( GAMEMODE_GetState( ) != GAMESTATE_INPROGRESS ) - return 0; + if ( gamestate != GAMESTATE_INPROGRESS ) + { + // [AK] This should never work while the game is in the results sequence. + if ( gamestate == GAMESTATE_INRESULTSEQUENCE ) + return 0; + + // [AK] This can only work while the game is in progress for the following game modes. + if (( survival ) || ( invasion ) || ( duel ) || ( lastmanstanding || teamlms ) || ( possession || teampossession )) + return 0; + } if ( PLAYER_IsValidPlayer ( ulPlayer ) == false ) return 0;