From a8dda856ccf8180a54377ec193d62fbb7e8f32f2 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 9 Mar 2018 17:55:06 +0200 Subject: [PATCH] Fixed statuseffect changes in a57bec2 not being added to one of the overloads of the Apply method --- .../Source/StatusEffects/StatusEffect.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/StatusEffects/StatusEffect.cs b/Barotrauma/BarotraumaShared/Source/StatusEffects/StatusEffect.cs index f6c812812..3eeb30378 100644 --- a/Barotrauma/BarotraumaShared/Source/StatusEffects/StatusEffect.cs +++ b/Barotrauma/BarotraumaShared/Source/StatusEffects/StatusEffect.cs @@ -277,11 +277,16 @@ namespace Barotrauma if (this.type != type || !HasRequiredItems(entity)) return; if (targetNames != null && !targetNames.Contains(target.Name)) return; - + if (duration > 0.0f && !Stackable) { //ignore if not stackable and there's already an identical statuseffect - if (DurationList.Any(d => d.Parent == this && d.Entity == entity && d.Targets.Count == 1 && d.Targets[0] == target)) return; + DurationListElement existingEffect = DurationList.Find(d => d.Parent == this && d.Targets.Count == 1 && d.Targets[0] == target)); + if (existingEffect != null) + { + existingEffect.Timer = Math.Max(existingEffect.Timer, duration); + return; + } } List targets = new List();