- Fixed structure-gap links not being saved

- Saving gap orientation
- Waypoint generation works with small hulls and even if SubBody doesn't exist
- Fixed charactermode when a editing mid-round
- Fixed powercontainer charge progressbar position
This commit is contained in:
Regalis
2016-01-24 21:28:27 +02:00
parent 28af6fa1f4
commit 278371638e
12 changed files with 107 additions and 17 deletions
+28
View File
@@ -178,6 +178,34 @@ namespace Barotrauma
InsertToList();
}
public static Rectangle GetBorders()
{
if (!hullList.Any()) return Rectangle.Empty;
Rectangle rect = hullList[0].rect;
foreach (Hull hull in hullList)
{
if (hull.Rect.X < rect.X)
{
rect.Width += rect.X - hull.rect.X;
rect.X = hull.rect.X;
}
if (hull.rect.Right > rect.Right) rect.Width = hull.rect.Right - rect.X;
if (hull.rect.Y > rect.Y)
{
rect.Height += hull.rect.Y - rect.Y;
rect.Y = hull.rect.Y;
}
if (hull.rect.Y - hull.rect.Height < rect.Y - rect.Height) rect.Height = rect.Y - (hull.rect.Y - hull.rect.Height);
}
return rect;
}
public static void GenerateEntityGrid()
{
entityGrid = new EntityGrid(Submarine.Borders, 200.0f);