A reference to the character who triggered a signal is passed to all the recipients of the signal. Allows more accurate server logging: using doors, docking ports or turrets is now properly logged.
This commit is contained in:
@@ -155,7 +155,7 @@ namespace Barotrauma.Items.Components
|
||||
Wires[index] = wire;
|
||||
}
|
||||
|
||||
public void SendSignal(int stepsTaken, string signal, Item sender, float power)
|
||||
public void SendSignal(int stepsTaken, string signal, Item source, Character sender, float power)
|
||||
{
|
||||
for (int i = 0; i < MaxLinked; i++)
|
||||
{
|
||||
@@ -163,11 +163,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
Connection recipient = Wires[i].OtherConnection(this);
|
||||
if (recipient == null) continue;
|
||||
if (recipient.item == this.item || recipient.item == sender) continue;
|
||||
if (recipient.item == this.item || recipient.item == source) continue;
|
||||
|
||||
foreach (ItemComponent ic in recipient.item.components)
|
||||
{
|
||||
ic.ReceiveSignal(stepsTaken, signal, recipient, this.item, power);
|
||||
ic.ReceiveSignal(stepsTaken, signal, recipient, item, sender, power);
|
||||
}
|
||||
|
||||
foreach (StatusEffect effect in recipient.effects)
|
||||
|
||||
Reference in New Issue
Block a user