1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-05 16:45:34 +00:00

Trim down comment and change flag name

This commit is contained in:
Jacob Turnbull 2021-04-07 16:57:06 -05:00
parent bc8db8b8f5
commit d9376ee08e

View file

@ -92,7 +92,7 @@ namespace MWWorld
if (slot == slots_.first.end()) if (slot == slots_.first.end())
{ {
ContainerStoreIterator enchItem = invStore.getSelectedEnchantItem(); ContainerStoreIterator enchItem = invStore.getSelectedEnchantItem();
bool bReEquipEnchItem = false; bool reEquip = false;
for (slot = slots_.first.begin(); slot != slots_.first.end(); ++slot) for (slot = slots_.first.begin(); slot != slots_.first.end(); ++slot)
{ {
invStore.unequipSlot(*slot, actor, false); invStore.unequipSlot(*slot, actor, false);
@ -105,14 +105,13 @@ namespace MWWorld
invStore.equip(*slot, it, actor); invStore.equip(*slot, it, actor);
} }
//if an enchanted item was re-equipped, set reEquipEnchItem = true //Fix for issue of selected enchated item getting remmoved on cycle
if (invStore.getSlot(*slot) == enchItem) if (invStore.getSlot(*slot) == enchItem)
{ {
bReEquipEnchItem = true; reEquip = true;
} }
} }
//if re-equip flag is true, select the enchanted item again if (reEquip)
if (bReEquipEnchItem)
{ {
invStore.setSelectedEnchantItem(enchItem); invStore.setSelectedEnchantItem(enchItem);
} }