diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 23b911e8b..3cc61c44b 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -2166,10 +2166,10 @@ void AlignSlopes(void) { for (auto& sect : sector) { - if (sect.slopewallofs) + if (sect.slopewallofs > 0) { - walltype* pWall = §.walls[sect.slopewallofs]; - if (pWall->twoSided()) + walltype* pWall = sect.walls.Data() + sect.slopewallofs; // we must evade range checks here - some maps try to slope to a wall outside their own sector. + if (pWall >= wall.Data() && pWall <= &wall.Last() && pWall->twoSided()) { auto pNextSector = pWall->nextSector();