From 8a4b8cc2ca3f77cd40a61ef58ba4e6483b9abbaf Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 10 Dec 2018 10:36:40 +0200 Subject: [PATCH] - server CVARs can be changed only by settings controller Initially, settings controller flag was false by default It was not touched during construction and destruction of player_t instances though Now, with all members initialized in class definition, this flag must be saved and restored manually https://forum.zdoom.org/viewtopic.php?t=62830 --- src/d_player.h | 2 +- src/g_game.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_player.h b/src/d_player.h index 4eb207fa96..4acae8ac86 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -453,7 +453,7 @@ public: TObjPtr MUSINFOactor = nullptr; // For MUSINFO purposes int8_t MUSINFOtics = 0; - bool settings_controller = true; // Player can control game settings. + bool settings_controller = false; // Player can control game settings. int8_t crouching = 0; int8_t crouchdir = 0; diff --git a/src/g_game.cpp b/src/g_game.cpp index b0c09d9937..56ccd46b26 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1285,6 +1285,7 @@ void G_PlayerReborn (int player) log = p->LogText; chasecam = p->cheats & CF_CHASECAM; Bot = p->Bot; //Added by MC: + const bool settings_controller = p->settings_controller; // Reset player structure to its defaults p->~player_t(); @@ -1303,6 +1304,7 @@ void G_PlayerReborn (int player) p->LogText = log; p->cheats |= chasecam; p->Bot = Bot; //Added by MC: + p->settings_controller = settings_controller; p->oldbuttons = ~0, p->attackdown = true; p->usedown = true; // don't do anything immediately p->original_oldbuttons = ~0;