From 56582edb44c43bcc9db648084209fe0781d910bd Mon Sep 17 00:00:00 2001 From: sven-n Date: Thu, 5 Dec 2024 21:56:02 +0100 Subject: [PATCH] Fixed magic effect power up updates cause stat reset Some skills update the max stat, e.g. Swell Life skill. When updating an existing effect, the max stat was reset to the normal value, and directly boosted again. When then the max value is above the current, the current gets capped to the lower max. We prevent that now when the powerups are identical. --- src/GameLogic/MagicEffectsList.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/GameLogic/MagicEffectsList.cs b/src/GameLogic/MagicEffectsList.cs index 9311de22c..a6bf17fb1 100644 --- a/src/GameLogic/MagicEffectsList.cs +++ b/src/GameLogic/MagicEffectsList.cs @@ -166,6 +166,14 @@ private void UpdateEffect(MagicEffect effect) //// This doesn't only save traffic, it also looks better in game. magicEffect.Duration = effect.Duration; magicEffect.ResetTimer(); + + if (magicEffect.PowerUpElements.Select(e => e.Element) + .SequenceEqual(effect.PowerUpElements.Select(e => e.Element))) + { + // if the effect power ups are the same, we can leave it like that + return; + } + foreach (var powerUp in magicEffect.PowerUpElements) { this._owner.Attributes.RemoveElement(powerUp.Element, powerUp.Target);