diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index 4b4ed6f05..d70fca1ca 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -233,7 +233,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, int16_t sectnum, { if (TEST(sector[hitinfo->sect].extra, SECTFX_WARP_SECTOR)) { - if (TEST(wall[sector[hitinfo->sect].wallptr].cstat, CSTAT_WALL_WARP_HITSCAN)) + if (TEST(sector[hitinfo->sect].firstWall()->cstat, CSTAT_WALL_WARP_HITSCAN)) { // hit the floor of a sector that is a warping sector if (Warp(&hitinfo->pos.x, &hitinfo->pos.y, &hitinfo->pos.z, &hitinfo->sect)) diff --git a/source/games/sw/src/rotator.cpp b/source/games/sw/src/rotator.cpp index 3ea1b7202..07f001ae0 100644 --- a/source/games/sw/src/rotator.cpp +++ b/source/games/sw/src/rotator.cpp @@ -368,16 +368,14 @@ int DoRotator(DSWActor* actor) if (!pivot) return 0; - startwall = sp->sector()->wallptr; - endwall = startwall + sp->sector()->wallnum - 1; - // move points - for (w = startwall, ndx = 0; w <= endwall; w++) + ndx = 0; + for(auto& wal : wallsofsector(sp->sector())) { vec2_t const orig = { r->origX[ndx], r->origY[ndx] }; rotatepoint(pivot->pos.vec2, orig, r->pos, &nxy); - dragpoint(w, nxy.x, nxy.y); + dragpoint(&wal, nxy.x, nxy.y); ndx++; }