From 3d7b56eab12bb00420baad9edb80b06b8ad53072 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 24 Dec 2022 21:42:35 +1000 Subject: [PATCH] Delete casings that spawn in a solid to avoid glitchy behaviour This is cheaper on CPU time than doing it on the server since the client performs the trace anyway --- qcsrc/common/effects/qc/casings.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qcsrc/common/effects/qc/casings.qc b/qcsrc/common/effects/qc/casings.qc index 28789ff29..3de21aeda 100644 --- a/qcsrc/common/effects/qc/casings.qc +++ b/qcsrc/common/effects/qc/casings.qc @@ -82,9 +82,19 @@ void Casing_Draw(entity this) return; } + trace_startsolid = 0; // due to cl_casings_ticrate, traces are not always performed Movetype_Physics_MatchTicrate(this, autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy); //if (wasfreed(this)) // return; // deleted by touch function + + // prevent glitchy casings when the gun model is poking into a wall + // doing this here is cheaper than doing it on the server as the client performs the trace anyway + if (trace_startsolid) + { + delete(this); + this.drawmask = 0; + return; + } } SOUND(BRASS1, W_Sound("brass1")); -- 2.39.2