From 363d062685ee9d28be9565d0fbdffc4d5d2cc394 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Dec 2021 21:31:19 +0100 Subject: [PATCH] - minor sanity check improvements. --- source/games/sw/src/track.cpp | 2 +- source/games/sw/src/warp.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 3fbfcf049..15d7a0915 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -3140,7 +3140,7 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor) if (hit.hitWall == nullptr) return false; - if (hit.hitWall->nextSector() == nullptr) + if (!hit.hitWall->twoSided()) return false; zdiff = labs(sp->z - hit.hitWall->nextSector()->floorz) >> 8; diff --git a/source/games/sw/src/warp.cpp b/source/games/sw/src/warp.cpp index e24b21e94..48f6d6511 100644 --- a/source/games/sw/src/warp.cpp +++ b/source/games/sw/src/warp.cpp @@ -210,7 +210,7 @@ bool WarpSectorInfo(sectortype* sect, DSWActor** sp_warp) { *sp_warp = nullptr; - if (sect && !TEST(sect->extra, SECTFX_WARP_SECTOR)) + if (!sect || !TEST(sect->extra, SECTFX_WARP_SECTOR)) return false; SWStatIterator it(STAT_WARP);