From: TerminalHash Date: Sat, 6 May 2023 22:49:26 +0000 (+0300) Subject: net: true elegant solution (by fgsfds) X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=f85756cc73a5b539f5691d0ca26d574407033a16;p=d2df-sdl.git net: true elegant solution (by fgsfds) --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 34a387a..200a57a 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -728,6 +728,17 @@ begin CloseFile(s); end; +procedure ClearDebugCvars(); +begin + g_debug_Sounds := False; + g_debug_Frames := False; + g_debug_WinMsgs := False; + g_debug_MonsterOff := False; + g_debug_BotAIOff := 0; + g_debug_HealthBar := False; + g_Debug_Player := False; +end; + function g_Game_ModeToText(Mode: Byte): string; begin Result := ''; @@ -774,19 +785,6 @@ end; function g_Game_IsNet(): Boolean; begin Result := (gGameSettings.GameType in [GT_SERVER, GT_CLIENT]); - - if gGameSettings.GameType in [GT_SERVER, GT_CLIENT] then - begin - // set debug options to false to avoid cheaters - g_debug_Sounds := False; - g_debug_Frames := False; - g_debug_WinMsgs := False; - g_debug_MonsterOff := False; - g_debug_BotAIOff := 0; - g_debug_HealthBar := False; - g_Debug_Player := False; - Exit; - end; end; function g_Game_IsServer(): Boolean; @@ -4686,6 +4684,8 @@ begin g_Game_ClearLoading(); + ClearDebugCvars(); + // Íàñòðîéêè èãðû: gGameSettings.GameType := GT_SERVER; gGameSettings.GameMode := GameMode; @@ -4819,6 +4819,8 @@ begin g_Game_ClearLoading(); + ClearDebugCvars(); + // Íàñòðîéêè èãðû: gGameSettings.GameType := GT_CLIENT;