mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- added a sanity check to GL nodes loader for a potential crash.
This commit is contained in:
parent
d166211ce0
commit
6e28963141
1 changed files with 18 additions and 4 deletions
|
@ -338,7 +338,14 @@ static bool LoadGLSegs(FileReader * lump)
|
|||
|
||||
ml->side=LittleShort(ml->side);
|
||||
segs[i].sidedef = ldef->sidedef[ml->side];
|
||||
segs[i].frontsector = ldef->sidedef[ml->side]->sector;
|
||||
if (ldef->sidedef[ml->side] != NULL)
|
||||
{
|
||||
segs[i].frontsector = ldef->sidedef[ml->side]->sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
segs[i].frontsector = NULL;
|
||||
}
|
||||
if (ldef->flags & ML_TWOSIDED && ldef->sidedef[ml->side^1] != NULL)
|
||||
{
|
||||
segs[i].backsector = ldef->sidedef[ml->side^1]->sector;
|
||||
|
@ -346,7 +353,7 @@ static bool LoadGLSegs(FileReader * lump)
|
|||
else
|
||||
{
|
||||
ldef->flags &= ~ML_TWOSIDED;
|
||||
segs[i].backsector = 0;
|
||||
segs[i].backsector = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -385,7 +392,14 @@ static bool LoadGLSegs(FileReader * lump)
|
|||
|
||||
ml->side=LittleShort(ml->side);
|
||||
segs[i].sidedef = ldef->sidedef[ml->side];
|
||||
segs[i].frontsector = ldef->sidedef[ml->side]->sector;
|
||||
if (ldef->sidedef[ml->side] != NULL)
|
||||
{
|
||||
segs[i].frontsector = ldef->sidedef[ml->side]->sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
segs[i].frontsector = NULL;
|
||||
}
|
||||
if (ldef->flags & ML_TWOSIDED && ldef->sidedef[ml->side^1] != NULL)
|
||||
{
|
||||
segs[i].backsector = ldef->sidedef[ml->side^1]->sector;
|
||||
|
@ -393,7 +407,7 @@ static bool LoadGLSegs(FileReader * lump)
|
|||
else
|
||||
{
|
||||
ldef->flags &= ~ML_TWOSIDED;
|
||||
segs[i].backsector = 0;
|
||||
segs[i].backsector = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue