]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Increment cl_matchcount based on the counter before cl_hook_gameend is called, allows...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index e03dca633c28b54a030d1f65939437858daa0332..0593fdfb2d4bc86c03ef7db34e60ee1ac40a0ec8 100644 (file)
@@ -1694,7 +1694,12 @@ void CSQC_UpdateView(entity this, float w, float h)
        {
                if(calledhooks & HOOK_START)
                {
+                       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));
                        calledhooks |= HOOK_END;
                }
        }