diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 0bfb30675..64e04620e 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -856,7 +856,7 @@ void LocalPlayer::setAttributes() // fortify the attribute if (ptrCreatureStats->getAttribute(attributeIndex).getModifier() > 0) { - MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::MagicEffect::FortifyAttribute, attributeIndex, -1); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::FortifyAttribute, attributeIndex, -1); mwmp::Main::get().getGUIController()->refreshGuiMode(MWGui::GM_Inventory); } } @@ -887,7 +887,7 @@ void LocalPlayer::setSkills() // fortify the skill if (ptrNpcStats->getSkill(skillIndex).getModifier() > 0) { - MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::MagicEffect::FortifySkill, -1, skillIndex); + MechanicsHelper::unequipItemsByEffect(ptrPlayer, ESM::Enchantment::ConstantEffect, ESM::MagicEffect::FortifySkill, -1, skillIndex); mwmp::Main::get().getGUIController()->refreshGuiMode(MWGui::GM_Inventory); } } diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index a63d890f1..e0ecb0478 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -233,7 +233,7 @@ bool MechanicsHelper::doesEffectListContainEffect(const ESM::EffectList& effectL return false; } -void MechanicsHelper::unequipItemsByEffect(const MWWorld::Ptr& ptr, short effectId, short attributeId, short skillId) +void MechanicsHelper::unequipItemsByEffect(const MWWorld::Ptr& ptr, short enchantmentType, short effectId, short attributeId, short skillId) { MWBase::World *world = MWBase::Environment::get().getWorld(); MWWorld::InventoryStore &ptrInventory = ptr.getClass().getInventoryStore(ptr); @@ -249,7 +249,7 @@ void MechanicsHelper::unequipItemsByEffect(const MWWorld::Ptr& ptr, short effect { const ESM::Enchantment* enchantment = world->getStore().get().find(enchantmentName); - if (doesEffectListContainEffect(enchantment->mEffects, effectId, attributeId, skillId)) + if (enchantment->mData.mType == enchantmentType && doesEffectListContainEffect(enchantment->mEffects, effectId, attributeId, skillId)) ptrInventory.unequipSlot(slot, ptr); } } diff --git a/apps/openmw/mwmp/MechanicsHelper.hpp b/apps/openmw/mwmp/MechanicsHelper.hpp index cf0eaa273..b707c13fc 100644 --- a/apps/openmw/mwmp/MechanicsHelper.hpp +++ b/apps/openmw/mwmp/MechanicsHelper.hpp @@ -25,7 +25,7 @@ namespace MechanicsHelper void processAttack(mwmp::Attack attack, const MWWorld::Ptr& attacker); bool doesEffectListContainEffect(const ESM::EffectList& effectList, short effectId, short attributeId = -1, short skillId = -1); - void unequipItemsByEffect(const MWWorld::Ptr& ptr, short effectId, short attributeId = -1, short skillId = -1); + void unequipItemsByEffect(const MWWorld::Ptr& ptr, short enchantmentType, short effectId, short attributeId = -1, short skillId = -1); }