mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-26 05:41:07 +00:00
- Fixed: If the znodes were based on a map with more vertexes than the one it is being loaded
for, reject them. SVN r3477 (trunk)
This commit is contained in:
parent
f82024efbf
commit
ac0c1eb64b
2 changed files with 7 additions and 6 deletions
|
@ -851,7 +851,6 @@ static int FindGLNodesInFile(FileReader * f, const char * label)
|
||||||
|
|
||||||
bool P_LoadGLNodes(MapData * map)
|
bool P_LoadGLNodes(MapData * map)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (map->MapLumps[ML_GLZNODES].Size != 0)
|
if (map->MapLumps[ML_GLZNODES].Size != 0)
|
||||||
{
|
{
|
||||||
const int idcheck = MAKE_ID('Z','G','L','N');
|
const int idcheck = MAKE_ID('Z','G','L','N');
|
||||||
|
|
|
@ -974,6 +974,11 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
data >> orgVerts >> newVerts;
|
data >> orgVerts >> newVerts;
|
||||||
|
if (orgVerts > (DWORD)numvertexes)
|
||||||
|
{ // These nodes are based on a map with more vertex data than we have.
|
||||||
|
// We can't use them.
|
||||||
|
throw CRecoverableError("Incorrect number of vertexes in nodes.\n");
|
||||||
|
}
|
||||||
if (orgVerts + newVerts == (DWORD)numvertexes)
|
if (orgVerts + newVerts == (DWORD)numvertexes)
|
||||||
{
|
{
|
||||||
newvertarray = vertexes;
|
newvertarray = vertexes;
|
||||||
|
@ -1026,10 +1031,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
|
||||||
// segs used by subsectors.
|
// segs used by subsectors.
|
||||||
if (numSegs != currSeg)
|
if (numSegs != currSeg)
|
||||||
{
|
{
|
||||||
Printf ("Incorrect number of segs in nodes.\n");
|
throw CRecoverableError("Incorrect number of segs in nodes.\n");
|
||||||
delete[] subsectors;
|
|
||||||
ForceNodeBuild = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
numsegs = numSegs;
|
numsegs = numSegs;
|
||||||
|
@ -3754,7 +3756,7 @@ void P_SetupLevel (char *lumpname, int position)
|
||||||
{
|
{
|
||||||
if (P_LoadGLNodes(map))
|
if (P_LoadGLNodes(map))
|
||||||
{
|
{
|
||||||
ForceNodeBuild=false;
|
ForceNodeBuild = false;
|
||||||
reloop = true;
|
reloop = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue