From: DeaDDooMER Date: Tue, 21 Feb 2023 18:17:25 +0000 (+0300) Subject: game: fix spectator mode switch X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=02521d15eb6020ddac536714d2eefedd69fd0f6e game: fix spectator mode switch --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index fc06d89..3105360 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -2259,8 +2259,16 @@ begin (* spectator state check from render *) - if (gPlayer1 = nil) and (gPlayer2 = nil) and (gSpectMode = SPECT_NONE) then - gSpectMode := SPECT_STATS; + if (gPlayer1 = nil) and (gPlayer2 = nil) then + begin + (* no local players -> automatically enable to spectator mode *) + if gSpectMode = SPECT_NONE then gSpectMode := SPECT_STATS; + end + else + begin + (* at least one local player -> automatically disable spectator mode *) + gSpectMode := SPECT_NONE; + end; if IsActivePlayer(g_Player_Get(gSpectPID1)) = false then gSpectPID1 := GetActivePlayerID_Next();