From: Mario Date: Wed, 1 Jun 2016 04:39:43 +0000 (+1000) Subject: Move nexball eventchase handling into nexball file X-Git-Tag: xonotic-v0.8.2~890 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=773e44a6b5e6c2ac7aac0534f2c5e7e68ba63771;p=xonotic%2Fxonotic-data.pk3dir.git Move nexball eventchase handling into nexball file --- diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index d797cee33..5b4297867 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index e00bdddf2..ae7057934 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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) diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index a1024542f..426cab70e 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -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);