mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +00:00
Fixed crash caused by 0-length lines in UDMF
When line was removed during processing bogus entries remained in sidedefs array
This commit is contained in:
parent
f97efefe7e
commit
2bb16c684f
1 changed files with 10 additions and 3 deletions
|
@ -1934,10 +1934,17 @@ public:
|
|||
P_AdjustLine(&lines[line]);
|
||||
P_FinishLoadingLineDef(&lines[line], tempalpha[0]);
|
||||
}
|
||||
assert((unsigned)side <= level.sides.Size());
|
||||
if ((unsigned)side > level.sides.Size())
|
||||
|
||||
const int sideDelta = level.sides.Size() - side;
|
||||
assert(sideDelta >= 0);
|
||||
|
||||
if (sideDelta < 0)
|
||||
{
|
||||
Printf("Map had %d invalid side references\n", (int)level.sides.Size() - side);
|
||||
Printf("Map had %d invalid side references\n", abs(sideDelta));
|
||||
}
|
||||
else if (sideDelta > 0)
|
||||
{
|
||||
level.sides.Resize(side);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue