(932f9d67b) Fixed wire connections that have been done mid-round not working properly. Closes #1371

This commit is contained in:
Joonas Rikkonen
2019-03-31 19:13:39 +03:00
parent 9e1a4d8902
commit aeeacf6779
2 changed files with 8 additions and 14 deletions

View File

@@ -169,20 +169,6 @@ namespace Barotrauma.Items.Components
if (draggingConnected.Connect(this, !alreadyConnected, true))
{
var otherConnection = draggingConnected.OtherConnection(this);
#if SERVER
//TODO: ffs
if (otherConnection == null)
{
GameServer.Log(Character.Controlled.LogName + " connected a wire to " +
Item.Name + " (" + Name + ")", ServerLog.MessageType.ItemInteraction);
}
else
{
GameServer.Log(Character.Controlled.LogName + " connected a wire from " +
Item.Name + " (" + Name + ") to " + otherConnection.item.Name + " (" + otherConnection.Name + ")", ServerLog.MessageType.ItemInteraction);
}
#endif
SetWire(index, draggingConnected);
}
}

View File

@@ -163,6 +163,14 @@ namespace Barotrauma.Items.Components
{
wires[index] = wire;
recipientsDirty = true;
if (wire != null)
{
var otherConnection = wire.OtherConnection(this);
if (otherConnection != null)
{
otherConnection.recipientsDirty = true;
}
}
}
public void SendSignal(int stepsTaken, string signal, Item source, Character sender, float power, float signalStrength = 1.0f)