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:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user