diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 7ea4a0bf1..efb6e1b65 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -490,7 +490,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor } if (item.getRefData().getCount() == 0 && mSelectedEnchantItem != end() - && *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player") + && *mSelectedEnchantItem == item) { mSelectedEnchantItem = end(); } @@ -521,11 +521,11 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c const std::string& script = it->getClass().getScript(*it); if (script != "") (*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0); + } - if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) - { - mSelectedEnchantItem = end(); - } + if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) + { + mSelectedEnchantItem = end(); } }