Skip to content

Commit

Permalink
- fixed validation issue with maps that have a wall with nextwall == …
Browse files Browse the repository at this point in the history
…-1 and nextsector > -1.

In this case the bogus nextsector was not reset.
  • Loading branch information
coelckers committed Feb 15, 2022
1 parent 21fddd6 commit de1cbb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions source/core/gamefuncs.h
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion source/core/maploader.cpp
Expand Up @@ -831,7 +831,11 @@ void setWallSectors()
wal.nextsector = wal.nextWall()->sector;
}
}
else wal.nextwall = -1;
else
{
wal.nextwall = -1;
wal.nextsector = -1;
}
}

}
Expand Down

0 comments on commit de1cbb9

Please sign in to comment.