From 7aa1b44cae6b84f98a6ceeff008aaad256b7c676 Mon Sep 17 00:00:00 2001 From: Regalis Date: Thu, 26 May 2016 16:08:55 +0300 Subject: [PATCH] Fixed flare lightcomponent staying active after the flare burns out, OnActive statuseffects are applied to lightcomponents even if the item is inside an inventory/container (= flares won't stop burning if placed back to inventory) --- Subsurface/Content/Items/Tools/tools.xml | 7 ++++--- .../Source/Items/Components/Signal/LightComponent.cs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml index 2715ebadc..b2f965c69 100644 --- a/Subsurface/Content/Items/Tools/tools.xml +++ b/Subsurface/Content/Items/Tools/tools.xml @@ -266,14 +266,15 @@ - - - + + + + diff --git a/Subsurface/Source/Items/Components/Signal/LightComponent.cs b/Subsurface/Source/Items/Components/Signal/LightComponent.cs index f25a95a1b..4fa63fdd7 100644 --- a/Subsurface/Source/Items/Components/Signal/LightComponent.cs +++ b/Subsurface/Source/Items/Components/Signal/LightComponent.cs @@ -123,6 +123,8 @@ namespace Barotrauma.Items.Components light.Submarine = item.Submarine; + ApplyStatusEffects(ActionType.OnActive, deltaTime); + if (item.Container != null) { light.Color = Color.Transparent; @@ -158,8 +160,6 @@ namespace Barotrauma.Items.Components else { lightBrightness = MathHelper.Lerp(lightBrightness, Math.Min(voltage, 1.0f), 0.1f); - - ApplyStatusEffects(ActionType.OnActive, deltaTime); } light.Color = lightColor * lightBrightness * (1.0f-Rand.Range(0.0f,Flicker)); @@ -167,7 +167,7 @@ namespace Barotrauma.Items.Components voltage = 0.0f; } - + public override bool Use(float deltaTime, Character character = null) { return true;