From 0b75f19da54f95b96eb383fe5f329fcb0bc6d22d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 15 Nov 2022 12:31:15 +0100 Subject: [PATCH] - use wallsofsector in clipmove. --- source/build/src/clip.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 60b9f4454..f49be0cc9 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -249,14 +249,11 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, ////////// Walls ////////// auto const sec = §or[dasect]; - int const startwall = sec->wallptr; - int const endwall = startwall + sec->wall_count(); - auto wal = &wall[startwall]; - for (int j=startwall; jpoint2Wall(); - vec2_t p1 = wal->wall_int_pos(); + auto const wal2 = wal.point2Wall(); + vec2_t p1 = wal.wall_int_pos(); vec2_t p2 = wal2->wall_int_pos(); if ((p1.X < clipMin.X && p2.X < clipMin.X) || (p1.X > clipMax.X && p2.X > clipMax.X) || @@ -276,7 +273,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, int clipyou = 0; - if (wal->nextsector < 0 || (wal->cstat & EWallFlags::FromInt(dawalclipmask))) + if (wal.nextsector < 0 || (wal.cstat & EWallFlags::FromInt(dawalclipmask))) { clipyou = 1; } @@ -284,7 +281,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { DVector2 ipos; clipmove_tweak_pos(pos, diff.X, diff.Y, p1.X, p1.Y, p2.X, p2.Y, &ipos.X, &ipos.Y); - clipyou = checkOpening(ipos, pos->Z * zinttoworld, §or[dasect], wal->nextSector(), + clipyou = checkOpening(ipos, pos->Z * zinttoworld, §or[dasect], wal.nextSector(), ceildist * zinttoworld, flordist * zinttoworld, enginecompatibility_mode == ENGINECOMPATIBILITY_NONE); v.X = int(ipos.X * worldtoint); v.Y = int(ipos.Y * worldtoint); @@ -295,11 +292,16 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && !curspr && dasect != initialsectnum && inside(pos->X * inttoworld, pos->Y * inttoworld, sec) == 1) { - int k; - for (k=startwall; knextsector>=0) + else if (wal.nextsector>=0) { - if (!clipsectormap[wal->nextsector]) - addclipsect(wal->nextsector); + if (!clipsectormap[wal.nextsector]) + addclipsect(wal.nextsector); } }