From: bones_was_here Date: Sat, 24 Dec 2022 11:42:35 +0000 (+1000) Subject: Delete casings that spawn in a solid to avoid glitchy behaviour X-Git-Tag: xonotic-v0.8.6~235^2~2 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=3d7b56eab12bb00420baad9edb80b06b8ad53072;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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"));