From aeeacf67791e4197675a76e1c35bb7d909f0d10f Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 31 Mar 2019 19:13:39 +0300 Subject: [PATCH] (932f9d67b) Fixed wire connections that have been done mid-round not working properly. Closes #1371 --- .../Source/Items/Components/Signal/Connection.cs | 14 -------------- .../Source/Items/Components/Signal/Connection.cs | 8 ++++++++ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs index e1d57fa4b..53c247abe 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs @@ -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); } } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/Connection.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/Connection.cs index 49a620e56..27335ef0c 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/Connection.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Signal/Connection.cs @@ -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)