mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 18:06:41 +00:00
Merge branch 'enchanted-item-selected-fix' into 'master'
Fix for enchanted items being removed on item equip cycling when they are re-equipped See merge request OpenMW/openmw!714
This commit is contained in:
commit
b8128d09f9
1 changed files with 19 additions and 3 deletions
|
@ -91,13 +91,29 @@ namespace MWWorld
|
|||
// move all slots one towards begin(), then equip the item in the slot that is now free
|
||||
if (slot == slots_.first.end())
|
||||
{
|
||||
for (slot=slots_.first.begin();slot!=slots_.first.end(); ++slot)
|
||||
ContainerStoreIterator enchItem = invStore.getSelectedEnchantItem();
|
||||
bool reEquip = false;
|
||||
for (slot = slots_.first.begin(); slot != slots_.first.end(); ++slot)
|
||||
{
|
||||
invStore.unequipSlot(*slot, actor, false);
|
||||
if (slot+1 != slots_.first.end())
|
||||
invStore.equip(*slot, invStore.getSlot(*(slot+1)), actor);
|
||||
if (slot + 1 != slots_.first.end())
|
||||
{
|
||||
invStore.equip(*slot, invStore.getSlot(*(slot + 1)), actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
invStore.equip(*slot, it, actor);
|
||||
}
|
||||
|
||||
//Fix for issue of selected enchated item getting remmoved on cycle
|
||||
if (invStore.getSlot(*slot) == enchItem)
|
||||
{
|
||||
reEquip = true;
|
||||
}
|
||||
}
|
||||
if (reEquip)
|
||||
{
|
||||
invStore.setSelectedEnchantItem(enchItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue