- validate 'nextsector' fields on walls.

Build utterly relied on the map having these right and put the entire responsibility on the mapper.
There's maps, however which have bad values here causing either render glitches or crashes so these bad indices need to be fixed.
Two good examples where this causes problems are RR's E3L1 and the second map of SW's Last Warrior mod where this even glitches in Polymost.
This commit is contained in:
Christoph Oelckers 2021-07-27 22:11:53 +02:00
parent 9a8ee00aec
commit bd23ea144c

View file

@ -493,4 +493,18 @@ void setWallSectors()
wall[sector[i].wallptr + w].sector = i;
}
}
// validate 'nextsector' fields. Some maps have these wrong which can cause render glitches and occasionally even crashes.
for (int i = 0; i < numwalls; i++)
{
if (wall[i].nextwall != -1)
{
if (wall[i].nextsector != wall[wall[i].nextwall].sector)
{
DPrintf(DMSG_ERROR, "Bad 'nextsector' reference %d on wall %d\n", wall[i].nextsector, i);
wall[i].nextsector = wall[wall[i].nextwall].sector;
}
}
}
}