]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/Main.qc
Improve the cutsound code. Unfortunately, as long as the cutsound feature is enabled...
[voretournament/voretournament.git] / data / qcsrc / client / Main.qc
index ae4ab68ef5586db613f0a9a1b00fc99fa700b4ed..06bb675bccf968a3dfb7731325cf5a6eb51c758b 100644 (file)
@@ -118,7 +118,7 @@ void CSQC_Init(void)
 \r
        postinit = false;\r
 \r
-       calledgrabbers = 0;\r
+       calledhooks = 0;\r
 \r
        teams = Sort_Spawn();\r
        players = Sort_Spawn();\r
@@ -207,10 +207,18 @@ void CSQC_Shutdown(void)
 \r
        if not(isdemo())\r
        {\r
-               if not(calledgrabbers & GRABBER_START)\r
+               if not(calledhooks & HOOK_START)\r
+               {\r
                        localcmd("\n_cl_hook_gamestart nop;");\r
-               if not(calledgrabbers & GRABBER_END)\r
+                       if(g_campaign) // this is a server cvar used in the client code, but g_campaign is always local, so it should be safe\r
+                               localcmd("\n_cl_hook_campaign_gamestart nop;");\r
+               }\r
+               if not(calledhooks & HOOK_END)\r
+               {\r
                        localcmd("\ncl_hook_gameend;");\r
+                       if(g_campaign)\r
+                               localcmd("\ncl_hook_campaign_gameend;");\r
+               }\r
        }\r
 }\r
 \r
@@ -947,7 +955,9 @@ void Gamemode_Init()
        if not(isdemo())\r
        {\r
                localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";");\r
-               calledgrabbers |= GRABBER_START;\r
+               if(g_campaign)\r
+                       localcmd("\n_cl_hook_campaign_gamestart ", GametypeNameFromType(gametype), ";");\r
+               calledhooks |= HOOK_START;\r
        }\r
 }\r
 // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided.  To execute standard behavior, simply execute localcmd with the string.\r
@@ -1009,10 +1019,13 @@ void Ent_Init()
                strunzone(forcefog);\r
        forcefog = strzone(ReadString());\r
 \r
+       g_campaign = ReadCoord();\r
+\r
        armorblockpercent = ReadByte() / 255.0;\r
 \r
        g_weaponswitchdelay = ReadByte() / 255.0;\r
 \r
+       g_vore = ReadCoord();\r
        g_balance_vore_swallow_limit = ReadCoord();\r
 \r
        if(!postinit)\r