From 4a1ba21067ee92fb18b6ad4ac29f2190eace4b06 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 12 Dec 2017 22:21:29 +0200 Subject: [PATCH] Fixed OnActive statuseffects not being applied on powered items that don't require power (prevented flare particles from working because they are configured in the LightComponent that inherits from Powered) --- .../Source/Items/Components/Power/Powered.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Power/Powered.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Power/Powered.cs index 3f17757a3..60e3da7d2 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Power/Powered.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Power/Powered.cs @@ -88,7 +88,16 @@ namespace Barotrauma.Items.Components public override void Update(float deltaTime, Camera cam) { - if (currPowerConsumption == 0.0f) return; + if (currPowerConsumption == 0.0f) + { + //if the item consumes no power, ignore the voltage requirement and + //apply OnActive statuseffects as long as this component is active + if (powerConsumption == 0.0f) + { + ApplyStatusEffects(ActionType.OnActive, deltaTime, null); + } + return; + } #if CLIENT if (voltage > minVoltage)