1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-25 21:41:04 +00:00
This commit is contained in:
kuyondo 2021-11-29 19:04:34 +08:00
parent 9d7a53b701
commit 01a9eaf4a8

View File

@ -289,13 +289,8 @@ namespace MWMechanics
MWWorld::Ptr ptr = getPlayer();
MWBase::WindowManager *winMgr = MWBase::Environment::get().getWindowManager();
// Update the equipped weapon icon
MWWorld::InventoryStore& inv = ptr.getClass().getInventoryStore(ptr);
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
if (weapon == inv.end())
winMgr->unsetSelectedWeapon();
else
winMgr->setSelectedWeapon(*weapon);
// Update the selected spell icon
MWWorld::ContainerStoreIterator enchantItem = inv.getSelectedEnchantItem();
@ -310,6 +305,12 @@ namespace MWMechanics
winMgr->unsetSelectedSpell();
}
// Update the equipped weapon icon
if (weapon == inv.end())
winMgr->unsetSelectedWeapon();
else
winMgr->setSelectedWeapon(*weapon);
if (mUpdatePlayer)
{
mUpdatePlayer = false;