Fixed crashing when attempting to generate hulls with the "autohull" command when there are no walls or doors in the sub.

This commit is contained in:
Joonas Rikkonen
2018-07-24 13:21:02 +03:00
parent 65b8d2d36e
commit 5e6215a37c

View File

@@ -1082,6 +1082,12 @@ namespace Barotrauma
}
}
if (wallPoints.Count < 4)
{
DebugConsole.ThrowError("Generating hulls for the submarine failed. Not enough wall structures to generate hulls.");
return;
}
min = wallPoints[0];
max = wallPoints[0];
for (int i = 0; i < wallPoints.Count; i++)