From 72d2daae90474fa79940440af84f9bbd5518ff13 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Wed, 29 Jun 2016 22:54:11 +0200 Subject: [PATCH] Fix InventoryStore::purgeEffect being reverted by the next recalculation of mMagicEffects --- apps/openmw/mwworld/inventorystore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 08436b238..e8a4d1c4d 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -722,7 +722,11 @@ void MWWorld::InventoryStore::rechargeItems(float duration) void MWWorld::InventoryStore::purgeEffect(short effectId) { - mMagicEffects.remove(MWMechanics::EffectKey(effectId)); + for (TSlots::const_iterator it = mSlots.begin(); it != mSlots.end(); ++it) + { + if (*it != end()) + purgeEffect(effectId, (*it)->getCellRef().getRefId()); + } } void MWWorld::InventoryStore::purgeEffect(short effectId, const std::string &sourceId)