Fixed motion sensors sending out signals even if the output is set to nothing. Closes #426
This commit is contained in:
@@ -49,14 +49,9 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
if (motionDetected)
|
string signalOut = motionDetected ? output : falseOutput;
|
||||||
{
|
|
||||||
item.SendSignal(1, output, "state_out", null);
|
if (!string.IsNullOrEmpty(signalOut)) item.SendSignal(1, signalOut, "state_out", null);
|
||||||
}
|
|
||||||
else if (!string.IsNullOrWhiteSpace(falseOutput))
|
|
||||||
{
|
|
||||||
item.SendSignal(1, falseOutput, "state_out", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateTimer -= deltaTime;
|
updateTimer -= deltaTime;
|
||||||
if (updateTimer > 0.0f) return;
|
if (updateTimer > 0.0f) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user