mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
Mapster32 corruptcheck: if some members out of MAX bounds, signal level 5.
git-svn-id: https://svn.eduke32.com/eduke32@3744 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8dd73d0fe8
commit
c86bf550a5
2 changed files with 25 additions and 6 deletions
|
@ -8058,7 +8058,9 @@ int32_t LoadBoard(const char *filename, uint32_t flags)
|
|||
char msgtail[64];
|
||||
const int32_t ci = CheckMapCorruption(4, 0);
|
||||
|
||||
if (ci >= 4)
|
||||
if (ci == 5)
|
||||
Bstrcpy(msgtail, "^12(EXTREME corruption)");
|
||||
else if (ci == 4)
|
||||
Bstrcpy(msgtail, "^12(HEAVY corruption)");
|
||||
else if (i > 0)
|
||||
Bsprintf(msgtail, "^14(removed %d sprites)", i);
|
||||
|
|
|
@ -11623,7 +11623,12 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
|
|||
numw = sector[i].wallnum;
|
||||
|
||||
if (w0 < 0 || w0 > numwalls)
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_SECTOR|i, "SECTOR[%d].WALLPTR=%d out of range (numwalls=%d)", i, w0, numw);
|
||||
{
|
||||
if (w0 < 0 || w0 >= MAXWALLS)
|
||||
CORRUPTCHK_PRINT(5, CORRUPT_SECTOR|i, "SECTOR[%d].WALLPTR=%d INVALID!!!", i, w0);
|
||||
else
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_SECTOR|i, "SECTOR[%d].WALLPTR=%d out of range (numwalls=%d)", i, w0, numw);
|
||||
}
|
||||
|
||||
if (w0 != ewall)
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_SECTOR|i, "SECTOR[%d].WALLPTR=%d inconsistent, expected %d", i, w0, ewall);
|
||||
|
@ -11695,12 +11700,24 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
|
|||
ns = wall[j].nextsector;
|
||||
|
||||
if (nw >= numwalls)
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL[%d].NEXTWALL=%d out of range: numwalls=%d",
|
||||
j, nw, numwalls);
|
||||
{
|
||||
if (nw >= MAXWALLS)
|
||||
CORRUPTCHK_PRINT(5, CORRUPT_WALL|j, "WALL[%d].NEXTWALL=%d INVALID!!!",
|
||||
j, nw);
|
||||
else
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL[%d].NEXTWALL=%d out of range: numwalls=%d",
|
||||
j, nw, numwalls);
|
||||
}
|
||||
|
||||
if (ns >= numsectors)
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL[%d].NEXTSECTOR=%d out of range: numsectors=%d",
|
||||
j, ns, numsectors);
|
||||
{
|
||||
if (ns >= MAXSECTORS)
|
||||
CORRUPTCHK_PRINT(5, CORRUPT_WALL|j, "WALL[%d].NEXTSECTOR=%d INVALID!!!",
|
||||
j, ns);
|
||||
else
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL[%d].NEXTSECTOR=%d out of range: numsectors=%d",
|
||||
j, ns, numsectors);
|
||||
}
|
||||
|
||||
if (nw>=w0 && nw<=endwall)
|
||||
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL[%d].NEXTWALL is its own sector's wall", j);
|
||||
|
|
Loading…
Reference in a new issue