Sub editor doesn't allow creating structures with zero width/height, fixed null exceptions when trying to remove a structure without wall sections

This commit is contained in:
Regalis
2017-04-20 18:02:20 +03:00
parent acaa8697c8
commit a5d605e29b
2 changed files with 16 additions and 13 deletions

View File

@@ -469,14 +469,18 @@ namespace Barotrauma
GameMain.World.RemoveBody(b);
}
foreach (WallSection s in sections)
if (sections != null)
{
if (s.gap != null)
foreach (WallSection s in sections)
{
s.gap.Remove();
s.gap = null;
if (s.gap != null)
{
s.gap.Remove();
s.gap = null;
}
}
}
if (convexHulls != null) convexHulls.ForEach(x => x.Remove());
}