Skip to content

Commit

Permalink
- Fixed: check for bad sidedefs was not taking into account sidedef c…
Browse files Browse the repository at this point in the history
…ompression.
  • Loading branch information
drfrag666 authored and coelckers committed Jun 12, 2020
1 parent fe19aec commit 476ab9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/maploader/maploader.cpp
Expand Up @@ -1675,6 +1675,7 @@ void MapLoader::LoadLineDefs (MapData * map)

auto mldf = map->Read(ML_LINEDEFS);
int numlines = mldf.Size() / sizeof(maplinedef_t);
int numsides = map->Size(ML_SIDEDEFS) / sizeof(mapsidedef_t);
linemap.Resize(numlines);

// [RH] Count the number of sidedef references. This is the number of
Expand Down Expand Up @@ -1743,7 +1744,7 @@ void MapLoader::LoadLineDefs (MapData * map)
// cph 2006/09/30 - fix sidedef errors right away.
for (int j=0; j < 2; j++)
{
if (LittleShort(mld->sidenum[j]) != NO_INDEX && mld->sidenum[j] >= Level->sides.Size())
if (LittleShort(mld->sidenum[j]) != NO_INDEX && mld->sidenum[j] >= numsides)
{
mld->sidenum[j] = 0; // dummy sidedef
Printf("Linedef %d has a bad sidedef\n", i);
Expand Down

0 comments on commit 476ab9c

Please sign in to comment.