Fixed door gaps being removed twice when unloading a sub (in door.Remove and Entity.RemoveAll). Probably didn't cause any issues other than unnecessary console warnings.

This commit is contained in:
Joonas Rikkonen
2018-07-24 13:19:07 +03:00
parent a63ee41e5f
commit 65b8d2d36e

View File

@@ -334,9 +334,13 @@ namespace Barotrauma.Items.Components
body.Remove();
body = null;
}
if (linkedGap != null) linkedGap.Remove();
//no need to remove the gap if we're unloading the whole submarine
//otherwise the gap will be removed twice and cause console warnings
if (!Submarine.Unloading)
{
if (linkedGap != null) linkedGap.Remove();
}
doorSprite.Remove();
if (weldedSprite != null) weldedSprite.Remove();