This commit is contained in:
Regalis11
2015-06-06 16:03:47 +03:00
28 changed files with 411 additions and 137 deletions
@@ -398,6 +398,13 @@ namespace Subsurface.Items.Components
{
XElement newElement = new XElement(isOutput ? "output" : "input", new XAttribute("name", name));
Array.Sort(wires, delegate(Wire wire1, Wire wire2)
{
if (wire1 == null) return 1;
if (wire2 == null) return -1;
return wire1.Item.ID.CompareTo(wire2.Item.ID);
});
for (int i = 0; i < MaxLinked; i++ )
{
if (wires[i] == null) continue;
@@ -406,7 +413,7 @@ namespace Subsurface.Items.Components
//int connectionIndex = recipient.item.Connections.FindIndex(x => x == recipient);
newElement.Add(new XElement("link",
new XAttribute("w", (wires[i] == null) ? "-1" : wires[i].Item.ID.ToString())));
new XAttribute("w", wires[i].Item.ID.ToString())));
}
parentElement.Add(newElement);