From 6676cb666692a7d4a10e29e23599a1b3d2f3ef58 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 14 Oct 2022 22:52:52 +0200 Subject: [PATCH] Properly set serverflags's flags --- qcsrc/common/constants.qh | 1 + qcsrc/common/playerstats.qc | 3 +++ qcsrc/server/world.qc | 1 + 3 files changed, 5 insertions(+) diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index feaa9f865..a60a9de13 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -12,6 +12,7 @@ const int CVAR_NOTIFY = BIT(1); const int CVAR_READONLY = BIT(2); // server flags +// NOTE: the engine doesn't clear serverflags on map change (gotomap) const int SERVERFLAG_ALLOW_FULLBRIGHT = BIT(0); const int SERVERFLAG_TEAMPLAY = BIT(1); const int SERVERFLAG_PLAYERSTATS = BIT(2); diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index e83305886..17c76461f 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -278,6 +278,9 @@ void PlayerStats_GameReport(bool finished) void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that scores are added properly { + serverflags &= ~SERVERFLAG_PLAYERSTATS; + serverflags &= ~SERVERFLAG_PLAYERSTATS_CUSTOM; + if(autocvar_g_playerstats_gamereport_uri == "") { return; } PS_GR_OUT_DB = db_create(); diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index f9e7ad16c..4334cb422 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -2090,6 +2090,7 @@ void readplayerstartcvars() void readlevelcvars() { + serverflags &= ~SERVERFLAG_ALLOW_FULLBRIGHT; if(cvar("sv_allow_fullbright")) serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; -- 2.39.2