diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 6bc5af57c..0b1f4b641 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -139,9 +139,8 @@ void vertexscan(walltype* startwall, func mark) while (true) { auto thelastwall = wal->lastWall(); - // thelastwall can be null here if the map is bogus. - if (!thelastwall || !thelastwall->twoSided()) break; - + // thelastwall can be null here if the map is bogus. + if (!thelastwall || thelastwall->nextwall < 0) break; wal = thelastwall->nextWall(); if (walbitmap.Check(wall.IndexOf(wal))) break; mark(wal); diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index 237af13b7..71ed37d92 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -831,7 +831,11 @@ void setWallSectors() wal.nextsector = wal.nextWall()->sector; } } - else wal.nextwall = -1; + else + { + wal.nextwall = -1; + wal.nextsector = -1; + } } }