Merge branch 'terencehill/casings' into 'master'
authorMario <zacjardine@y7mail.com>
Sun, 18 Aug 2019 09:22:32 +0000 (09:22 +0000)
committerMario <zacjardine@y7mail.com>
Sun, 18 Aug 2019 09:22:32 +0000 (09:22 +0000)
Casings tweaks and fixes

Closes #2253

See merge request xonotic/xonotic-data.pk3dir!689

qcsrc/client/autocvars.qh
qcsrc/common/effects/qc/casings.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/server/client.qh

index 59ecb04d2386ec64ad765cda87703eccba9550ab..c372be250b5ad0dae82b4b642bdc3c1d32b4e40a 100644 (file)
@@ -25,7 +25,6 @@ float autocvar_cl_announcer_antispam = 2;
 float autocvar_cl_announcer_maptime = 3;
 bool autocvar_cl_autodemo_delete;
 bool autocvar_cl_autodemo_delete_keeprecords;
-bool autocvar_cl_casings;
 float autocvar_cl_casings_bronze_time;
 int autocvar_cl_casings_maxcount = 100;
 float autocvar_cl_casings_shell_time;
index d225b337bc70bfd46d5dd55445d2ba6668b3bd7e..304552961c1a4a5ce1af56b8ee11f77de1ad7cf4 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;
 
@@ -129,8 +136,6 @@ NET_HANDLE(casings, bool isNew)
     ang_z = ReadByte() * 360 / 256;
     return = true;
 
-    if (!autocvar_cl_casings) return;
-
     Casing casing = RubbleNew("casing");
     casing.silent = (_state & 0x80);
     casing.state = (_state & 0x7F);
index cbb54cd26e575c8cb6e67740b0b48fa2f02516bf..b3f460ce7d99daaf5f6c1dab28832cbca57a5ad8 100644 (file)
@@ -348,6 +348,10 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this)  // SV_LinkEdict_TouchAreaGr
                        trace_plane_normal = '0 0 1';
                        trace_plane_dist = 0;
                        trace_ent = this;
+                       trace_dpstartcontents = 0;
+                       trace_dphitcontents = 0;
+                       trace_dphitq3surfaceflags = 0;
+                       trace_dphittexturename = string_null;
 
                        gettouch(it)(it, this);
                }
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);