From 69da5c23a328f3a605eb6a3a2f0f4e09078eeb2e Mon Sep 17 00:00:00 2001 From: Player701 Date: Mon, 12 Oct 2020 10:08:59 +0300 Subject: [PATCH] - Fixed: Server CVars did not immediately revert to their saved values upon loading a save file. https://forum.zdoom.org/viewtopic.php?f=2&t=70190 --- src/d_netinfo.cpp | 4 ++-- src/g_game.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index f2fb30bee..27c91d851 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -627,7 +627,7 @@ EXTERN_CVAR (Float, sv_gravity) bool D_SendServerInfoChange (FBaseCVar *cvar, UCVarValue value, ECVarType type) { - if (gamestate != GS_STARTUP && !demoplayback) + if (gamestate != GS_STARTUP && !demoplayback && !savegamerestore) { if (netgame && !players[consoleplayer].settings_controller) { @@ -657,7 +657,7 @@ bool D_SendServerInfoChange (FBaseCVar *cvar, UCVarValue value, ECVarType type) bool D_SendServerFlagChange (FBaseCVar *cvar, int bitnum, bool set, bool silent) { - if (gamestate != GS_STARTUP && !demoplayback) + if (gamestate != GS_STARTUP && !demoplayback && !savegamerestore) { if (netgame && !players[consoleplayer].settings_controller) { diff --git a/src/g_game.cpp b/src/g_game.cpp index c79ac5d77..81bc38e8b 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2041,6 +2041,8 @@ void G_DoLoadGame () primaryLevel->BotInfo.RemoveAllBots(primaryLevel, true); + savegamerestore = true; // Use the player actors in the savegame + FString cvar; arc("importantcvars", cvar); if (!cvar.IsEmpty()) @@ -2066,7 +2068,6 @@ void G_DoLoadGame () G_ReadVisited(arc); // load a base level - savegamerestore = true; // Use the player actors in the savegame bool demoplaybacksave = demoplayback; G_InitNew(map, false); demoplayback = demoplaybacksave;