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)

This commit is contained in:
Joonas Rikkonen
2017-12-12 22:21:29 +02:00
parent 7ce93d2e1f
commit 4a1ba21067

View File

@@ -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)