diff --git a/source/core/maptypes.h b/source/core/maptypes.h index ccc58fb99..40fcf2095 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -428,7 +428,6 @@ struct sectortype int getfloorslope() const { return floorstat & CSTAT_SECTOR_SLOPE ? floorheinum : 0; } int getceilingslope() const { return ceilingstat & CSTAT_SECTOR_SLOPE ? ceilingheinum : 0; } walltype* firstWall() const { return walls.Data(); } - walltype* lastWall() const { return &walls.Last(); } Blood::XSECTOR& xs() const { return *_xs; } diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 9eb69fc8f..0d83021d4 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -410,7 +410,7 @@ void HWDrawInfo::CreateScene(bool portal) auto sect = eff.geosectorwarp[i]; for (unsigned w = 0; w < sect->walls.Size(); w++) { - auto wal = sect->firstWall() + w; + auto wal = §->walls[w]; wal->pos.X += eff.geox[i]; wal->pos.Y += eff.geoy[i]; } @@ -429,7 +429,7 @@ void HWDrawInfo::CreateScene(bool portal) auto sect = eff.geosectorwarp[i]; for (unsigned w = 0; w < sect->walls.Size(); w++) { - auto wal = sect->firstWall() + w; + auto wal = §->walls[w]; wal->pos.X -= eff.geox[i]; wal->pos.Y -= eff.geoy[i]; } @@ -442,7 +442,7 @@ void HWDrawInfo::CreateScene(bool portal) auto sect = eff.geosectorwarp2[i]; for (unsigned w = 0; w < sect->walls.Size(); w++) { - auto wal = sect->firstWall() + w; + auto wal = §->walls[w]; wal->pos.X += eff.geox2[i]; wal->pos.Y += eff.geoy2[i]; } @@ -460,7 +460,7 @@ void HWDrawInfo::CreateScene(bool portal) auto sect = eff.geosectorwarp2[i]; for (unsigned w = 0; w < sect->walls.Size(); w++) { - auto wal = sect->firstWall() + w; + auto wal = §->walls[w]; wal->pos.X -= eff.geox2[i]; wal->pos.Y -= eff.geoy2[i]; } diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 10b2a94cd..23b911e8b 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -2168,7 +2168,7 @@ void AlignSlopes(void) { if (sect.slopewallofs) { - walltype* pWall = sect.firstWall() + sect.slopewallofs; + walltype* pWall = §.walls[sect.slopewallofs]; if (pWall->twoSided()) { auto pNextSector = pWall->nextSector(); diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 78d69976a..f289eceab 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -3386,7 +3386,7 @@ void moveeffectors_r(void) //STATNUM 3 if (act->spr.lotag != SE_29_WAVES) continue; auto sc = act->sector(); if (sc->walls.Size() != 4) continue; - auto wal = sc->firstWall() + 2; + auto wal = &sc->walls[2]; if (wal->nextSector()) alignflorslope(act->sector(), DVector3(wal->pos, wal->nextSector()->floorz)); } } diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index cfe241877..1f59bf601 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -2609,7 +2609,7 @@ void DoSineWaveFloor(void) if (sect->walls.Size() == 4) { //Set wal to the wall on the opposite side of the sector - wal = sect->firstWall() + 2; + wal = §->walls[2]; //Pass (Sector, x, y, z) alignflorslope(sect,DVector3(wal->pos, wal->nextSector()->floorz)); diff --git a/source/games/sw/src/slidor.cpp b/source/games/sw/src/slidor.cpp index bdaf731a1..98dd133d3 100644 --- a/source/games/sw/src/slidor.cpp +++ b/source/games/sw/src/slidor.cpp @@ -248,8 +248,8 @@ void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func) auto sect = actor->sector(); // this code is just weird. - auto startWall = sect->firstWall(); - auto endWall = sect->lastWall(); + auto startWall = §->walls[0]; + auto endWall = §->walls.Last(); auto wal = startWall; do { @@ -306,8 +306,8 @@ int DoSlidorMoveWalls(DSWActor* actor, double amt) auto sect = actor->sector(); // this code is just weird. - auto startWall = sect->firstWall(); - auto endWall = sect->lastWall(); + auto startWall = §->walls[0]; + auto endWall = §->walls.Last(); auto wal = startWall; walltype* pwal;