Skip to content

Commit

Permalink
Merge pull request #548 from MUnique/dev/fix-update-effect
Browse files Browse the repository at this point in the history
Fixed magic effect updates cause stat value reset
  • Loading branch information
sven-n authored Dec 8, 2024
2 parents 8b0cd76 + 56582ed commit f057288
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/GameLogic/MagicEffectsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f057288

Please sign in to comment.