From ed1f8f7be7b43d1ca6b1154c7b9f33633835d6c6 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Wed, 29 Aug 2018 13:40:37 +0300 Subject: [PATCH] Remove effects from all active spells with the same ID --- apps/openmw/mwmechanics/activespells.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/activespells.cpp b/apps/openmw/mwmechanics/activespells.cpp index 9e523a8453..57b009689c 100644 --- a/apps/openmw/mwmechanics/activespells.cpp +++ b/apps/openmw/mwmechanics/activespells.cpp @@ -197,11 +197,13 @@ namespace MWMechanics void ActiveSpells::removeEffects(const std::string &id) { - TContainer::iterator spell(mSpells.find(id)); - if (spell != end()); + for (TContainer::iterator spell = mSpells.begin(); spell != mSpells.end(); ++spell) { - spell->second.mEffects.clear(); - mSpellsChanged = true; + if (spell->first == id) + { + spell->second.mEffects.clear(); + mSpellsChanged = true; + } } }