- 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
+12 -2
View File
@@ -560,7 +560,9 @@ namespace Barotrauma
{
XElement element = new XElement("Gap");
element.Add(new XAttribute("ID", ID));
element.Add(
new XAttribute("ID", ID),
new XAttribute("horizontal", isHorizontal ? "true" : "false"));
element.Add(new XAttribute("rect",
(int)(rect.X - Submarine.HiddenSubPosition.X) + "," +
@@ -608,7 +610,15 @@ namespace Barotrauma
int.Parse(element.Attribute("height").Value));
}
Gap g = new Gap(rect, submarine);
bool isHorizontal = rect.Height > rect.Width;
var horizontalAttribute = element.Attribute("horizontal");
if (horizontalAttribute!=null)
{
isHorizontal = horizontalAttribute.Value.ToString() == "true";
}
Gap g = new Gap(rect, isHorizontal, submarine);
g.ID = (ushort)int.Parse(element.Attribute("ID").Value);
g.linkedToID = new List<ushort>();