]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Merge branch 'master' into develop
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index e5b38b76834bb1cb1d40335e058f2c9f71e2a6b8..4bb2ff9f1c41363749e7cca475bb5ab732c6fe57 100644 (file)
@@ -178,7 +178,14 @@ void Shutdown()
                if (!(calledhooks & HOOK_START))
                        localcmd("\n_cl_hook_gamestart nop\n");
                if (!(calledhooks & HOOK_END))
+               {
+                       int gamecount = cvar("cl_matchcount");
                        localcmd("\ncl_hook_gameend\n");
+                       // NOTE: using localcmd here to ensure it's executed AFTER cl_hook_gameend
+                       // earlier versions of the game abuse the hook to set this cvar
+                       localcmd(strcat("cl_matchcount ", itos(gamecount + 1), "\n"));
+                       //cvar_set("cl_matchcount", itos(gamecount + 1));
+               }
        }
 
        localcmd("\ncl_hook_shutdown\n");
@@ -437,6 +444,9 @@ void PostInit()
 
        TrueAim_Init();
 
+       // this can't be called in CSQC_Init as it'd send cvars too early
+       ReplicateVars_Start();
+
        postinit = true;
 }
 
@@ -665,9 +675,6 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
        spectatee_status = newspectatee_status;
 
        // we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum
-
-       // this can't be called in CSQC_Init as it'd send cvars too early
-       ReplicateVars_Start();
 }
 
 NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew)