]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly set serverflags's flags
authorterencehill <piuntn@gmail.com>
Fri, 14 Oct 2022 20:52:52 +0000 (22:52 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 14 Oct 2022 20:52:52 +0000 (22:52 +0200)
qcsrc/common/constants.qh
qcsrc/common/playerstats.qc
qcsrc/server/world.qc

index feaa9f8651ea47e3251ae867f5c88a335718edc0..a60a9de13ff0a6275a2b548aafcf785b052e2dcd 100644 (file)
@@ -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);
index e83305886cee1522ddbb5b8db4c11388ee59e0e7..17c76461fd3516a72b5355a39f906846cfe9f205 100644 (file)
@@ -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();
index f9e7ad16cb9f3a1ec8a15c25826eb1ecff88ecc0..4334cb422e3281c450a08034d14557046a80eac3 100644 (file)
@@ -2090,6 +2090,7 @@ void readplayerstartcvars()
 
 void readlevelcvars()
 {
+       serverflags &= ~SERVERFLAG_ALLOW_FULLBRIGHT;
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;