From ce1a479acec5ee3315b0c269e367f89e9cf315e2 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 17 Sep 2019 03:21:14 +0000 Subject: [PATCH] Fix bugged height check in cliptestsector() git-svn-id: https://svn.eduke32.com/eduke32@8118 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/clip.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index e48ff4816..c3e3b38d3 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -809,10 +809,10 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl if ((sec->floorstat|sec->ceilingstat) & 2) getcorrectzsofslope(dasect, pos.x, pos.y, &dacz, &daz); - int32_t const sec2height = daz2-dacz2; + int32_t const sec2height = klabs(daz2-dacz2); - return ((daz-dacz > sec2height && // clip if the current sector is taller and the next is too small - sec2height < (flordist+ceildist-(CLIPCURBHEIGHT<<1))) || + return ((klabs(daz-dacz) > sec2height && // clip if the current sector is taller and the next is too small + sec2height < (ceildist+(CLIPCURBHEIGHT<<1))) || ((sec2->floorstat&1) == 0 && // parallaxed floor curbs don't clip posz >= daz2-(flordist-1) && // also account for desired z distance tolerance