From: bones_was_here Date: Fri, 19 May 2023 13:09:26 +0000 (+1000) Subject: Fix visual glitch when traversing warpzones with sv_areagrid_link_SOLID_NOT 0 X-Git-Tag: xonotic-v0.8.6~98^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9a67d4c4f7f628087e284c864cb8f444436d2c6;p=xonotic%2Fxonotic-data.pk3dir.git Fix visual glitch when traversing warpzones with sv_areagrid_link_SOLID_NOT 0 At a specific position the black texture with green lines was visible. --- diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index ac32cffdd..12fc316fd 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -124,8 +124,10 @@ float WarpZoneLib_BoxTouchesBrush_Recurse(vector mi, vector ma, entity e, entity se = trace_ent; s = se.solid; se.solid = SOLID_NOT; + setorigin(se, se.origin); // unlink f = WarpZoneLib_BoxTouchesBrush_Recurse(mi, ma, e, ig); se.solid = s; + setorigin(se, se.origin); // relink return f; } @@ -146,9 +148,17 @@ float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig) ig.dphitcontentsmask |= 128; s = e.solid; - e.solid = SOLID_BSP; + if (e.solid != SOLID_BSP) + { + e.solid = SOLID_BSP; + setorigin(e, e.origin); // update linking + } f = WarpZoneLib_BoxTouchesBrush_Recurse(mi, ma, e, ig); - e.solid = s; + if (e.solid != s) // if we needed to change .solid temporarily + { + e.solid = s; // restore it + setorigin(e, e.origin); // update linking + } if (Q3COMPAT_COMMON && ig != world) ig.dphitcontentsmask &= ~128;