mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 15:53:54 +00:00
Fix mSelectedEnchantItem cleanup not working for non-player actors
This commit is contained in:
parent
d605019111
commit
3f503c6561
1 changed files with 5 additions and 5 deletions
|
@ -490,7 +490,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.getRefData().getCount() == 0 && mSelectedEnchantItem != end()
|
if (item.getRefData().getCount() == 0 && mSelectedEnchantItem != end()
|
||||||
&& *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player")
|
&& *mSelectedEnchantItem == item)
|
||||||
{
|
{
|
||||||
mSelectedEnchantItem = end();
|
mSelectedEnchantItem = end();
|
||||||
}
|
}
|
||||||
|
@ -521,11 +521,11 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c
|
||||||
const std::string& script = it->getClass().getScript(*it);
|
const std::string& script = it->getClass().getScript(*it);
|
||||||
if (script != "")
|
if (script != "")
|
||||||
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
||||||
|
}
|
||||||
|
|
||||||
if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it))
|
if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it))
|
||||||
{
|
{
|
||||||
mSelectedEnchantItem = end();
|
mSelectedEnchantItem = end();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue