Fixed wire connections being lost when copy-pasting in sub editor

This commit is contained in:
juanjp600
2017-12-03 11:59:29 -03:00
parent ddf9ad26b8
commit 3db407fe52
2 changed files with 6 additions and 2 deletions

View File

@@ -120,6 +120,11 @@ namespace Barotrauma.Items.Components
return componentElement;
}
protected override void ShallowRemoveComponentSpecific()
{
//do nothing
}
protected override void RemoveComponentSpecific()
{
foreach (Connection c in Connections)

View File

@@ -223,9 +223,8 @@ namespace Barotrauma
//index of the connection in the connectionpanel of the target item
int connectionIndex = connectedItem.Connections.IndexOf(originalWire.Connections[n]);
(clones[itemIndex] as Item).GetComponent<ConnectionPanel>().Connections[connectionIndex].TryAddLink(cloneWire);
(clones[itemIndex] as Item).Connections[connectionIndex].TryAddLink(cloneWire);
cloneWire.Connect((clones[itemIndex] as Item).Connections[connectionIndex], false);
}
}