From 12eb413f9c41ec0772fa3dfbf92028fd9cee510e Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 19 Apr 2019 08:31:50 +0000 Subject: [PATCH] Fix SOS check in clipmove() git-svn-id: https://svn.eduke32.com/eduke32@7610 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/clip.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 6d1316697..7fe0b86d9 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -978,6 +978,8 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int uspriteptr_t curspr=NULL; // non-NULL when handling sprite with sector-like clipping + int const initialsectnum = *sectnum; + int32_t const dawalclipmask = (cliptype & 65535); // CLIPMASK0 = 0x00010001 int32_t const dasprclipmask = (cliptype >> 16); // CLIPMASK1 = 0x01000040 @@ -1141,7 +1143,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int } // We're not interested in any sector reached by portal traversal that we're "inside" of. - if (!curspr && clipsectcnt != 1 && inside(pos->x, pos->y, dasect) == 1) break; + if (!curspr && dasect != initialsectnum && inside(pos->x, pos->y, dasect) == 1) break; else if (clipyou) { int16_t const objtype = curspr ? (int16_t)(curspr - (uspritetype *)sprite) + 49152 : j + 32768; @@ -1160,7 +1162,6 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int } else if (wal->nextsector>=0) { - if (!curspr && inside(pos->x, pos->y, wal->nextsector) == 1) continue; if (bitmap_test(clipsectormap, wal->nextsector) == 0) addclipsect(wal->nextsector); }