Fixed wire connections & nodes resetting when copypasting them
This commit is contained in:
@@ -156,6 +156,10 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ShallowRemoveComponentSpecific()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
|
||||
public Connection OtherConnection(Connection connection)
|
||||
{
|
||||
if (connection == null) return null;
|
||||
@@ -686,7 +686,20 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
Drawable = nodes.Any();
|
||||
}
|
||||
|
||||
protected override void ShallowRemoveComponentSpecific()
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (connections[i] == null) continue;
|
||||
int wireIndex = connections[i].FindWireIndex(item);
|
||||
|
||||
if (wireIndex > -1)
|
||||
{
|
||||
connections[i].AddLink(wireIndex, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RemoveComponentSpecific()
|
||||
|
||||
Reference in New Issue
Block a user