]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't send casings data if client has casings turned off. Toggling cl_casings on...
authorterencehill <piuntn@gmail.com>
Fri, 16 Aug 2019 14:38:36 +0000 (16:38 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 16 Aug 2019 14:55:11 +0000 (16:55 +0200)
qcsrc/common/effects/qc/casings.qc
qcsrc/server/client.qh

index d225b337bc70bfd46d5dd55445d2ba6668b3bd7e..3573444a6ea004c0bd57cbc79a2be071a38494d7 100644 (file)
 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;
 
index 012e040f813da992f89ad999ac09aa4733d822bc..bc4a60e1a88d5f55d7688e0b5756d2f06329d885 100644 (file)
@@ -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);