]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move nexball eventchase handling into nexball file
authorMario <mario@smbclan.net>
Wed, 1 Jun 2016 04:39:43 +0000 (14:39 +1000)
committerMario <mario@smbclan.net>
Wed, 1 Jun 2016 04:39:43 +0000 (14:39 +1000)
qcsrc/client/autocvars.qh
qcsrc/client/view.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc

index d797cee330f4c6dbb358aab71d6c9dbf79f0114e..5b42978679d42b0dae2436762150c0c555cdcb5e 100644 (file)
@@ -412,7 +412,6 @@ float autocvar_cl_hitsound_max_pitch = 1.5;
 float autocvar_cl_hitsound_nom_damage = 25;
 float autocvar_cl_hitsound_antispam_time;
 int autocvar_cl_eventchase_death = 1;
-int autocvar_cl_eventchase_nexball = 1;
 vector autocvar_cl_eventchase_generator_viewoffset = '0 0 80';
 float autocvar_cl_eventchase_generator_distance = 400;
 float autocvar_cl_eventchase_distance = 140;
index e00bdddf29a59c111ccfd0ad97cea9bff071f77c..ae705793450651075782c73e01b308dba010d898 100644 (file)
@@ -741,8 +741,6 @@ bool WantEventchase(entity this)
                        return true;
                if(MUTATOR_CALLHOOK(WantEventchase, this))
                        return true;
-               if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
-                       return true;
                if(autocvar_cl_eventchase_death && (STAT(HEALTH) <= 0))
                {
                        if(autocvar_cl_eventchase_death == 2)
index a1024542f589437c41b8c75e42491f80fd9889c6..426cab70e151aea46122fac85d0896113cf1319e 100644 (file)
@@ -1,6 +1,18 @@
 #include "nexball.qh"
 
 #ifdef IMPLEMENTATION
+#ifdef CSQC
+int autocvar_cl_eventchase_nexball = 1;
+
+REGISTER_MUTATOR(cl_nb, true);
+
+MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
+{
+       if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
+               return true;
+       return false;
+}
+#endif
 #ifdef SVQC
 .float metertime = _STAT(NB_METERSTART);