- fixed some bogus range checks in automap code.

This commit is contained in:
Christoph Oelckers 2021-04-12 20:54:12 +02:00
parent 1e40e93da4
commit 92cdec077d

View file

@ -428,9 +428,12 @@ void drawredlines(int cposx, int cposy, int czoom, int cang)
for (j = startwall, wal = &wall[startwall]; j < endwall; j++, wal++) for (j = startwall, wal = &wall[startwall]; j < endwall; j++, wal++)
{ {
int k = wal->nextwall; int k = wal->nextwall;
if (k < 0 || k >= MAXWALLS) continue; if (k < 0 || k >= numwalls) continue;
if (sector[wal->nextsector].ceilingz == z1 && sector[wal->nextsector].floorz == z2) int s = wal->nextsector;
if (s < 0 || s >= numsectors) continue;
if (sector[s].ceilingz == z1 && sector[s].floorz == z2)
if (((wal->cstat | wall[wal->nextwall].cstat) & (16 + 32)) == 0) continue; if (((wal->cstat | wall[wal->nextwall].cstat) & (16 + 32)) == 0) continue;
if (ShowRedLine(j, i)) if (ShowRedLine(j, i))