From: terencehill Date: Fri, 16 Aug 2019 14:38:36 +0000 (+0200) Subject: Don't send casings data if client has casings turned off. Toggling cl_casings on... X-Git-Tag: xonotic-v0.8.5~1387^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=72f571cf9621a68a0992dbad748f6b3657a27463;p=xonotic%2Fxonotic-data.pk3dir.git Don't send casings data if client has casings turned off. Toggling cl_casings on/off now needs 'sendcvar cl_casings' to take effect otherwise it applies from the next match --- diff --git a/qcsrc/common/effects/qc/casings.qc b/qcsrc/common/effects/qc/casings.qc index d225b337b..3573444a6 100644 --- a/qcsrc/common/effects/qc/casings.qc +++ b/qcsrc/common/effects/qc/casings.qc @@ -10,8 +10,15 @@ REGISTER_NET_TEMP(casings) #ifdef SVQC + +.bool cvar_cl_casings; +REPLICATE(cvar_cl_casings, bool, "cl_casings"); + void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity) { + if (!(CS(casingowner).cvar_cl_casings)) + return; + entity wep = casingowner.(weaponentity); vector org = casingowner.origin + casingowner.view_ofs + wep.spawnorigin.x * v_forward - wep.spawnorigin.y * v_right + wep.spawnorigin.z * v_up; diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 012e040f8..bc4a60e1a 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -139,6 +139,7 @@ CLASS(Client, Object) ATTRIB(Client, cvar_cl_weaponimpulsemode, int, this.cvar_cl_weaponimpulsemode); ATTRIB(Client, cvar_g_xonoticversion, string, this.cvar_g_xonoticversion); ATTRIB(Client, autoswitch, bool, this.autoswitch); + ATTRIB(Client, cvar_cl_casings, bool, this.cvar_cl_casings); ATTRIB(Client, cvar_cl_dodging_timeout, float, this.cvar_cl_dodging_timeout); ATTRIB(Client, cvar_cl_multijump, bool, this.cvar_cl_multijump); ATTRIB(Client, cvar_cl_accuracy_data_share, bool, this.cvar_cl_accuracy_data_share);