Don't update magic effects when unequipping items to equip something else

cherry-pick-c431f31c
Evil Eye 4 years ago committed by Alexei Dobrohotov
parent dc82cb61f4
commit a257567b80

@ -81,6 +81,7 @@
Bug #5661: Region sounds don't play at the right interval
Bug #5675: OpenMW-cs. FRMR subrecords are saved with the wrong MastIdx
Bug #5681: Player character can clip or pass through bridges instead of colliding against them
Bug #5687: Bound items covering the same inventory slot expiring at the same time freezes the game
Bug #5688: Water shader broken indoors with enable indoor shadows = false
Bug #5695: ExplodeSpell for actors doesn't target the ground
Bug #5703: OpenMW-CS menu system crashing on XFCE

@ -762,7 +762,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor
return retCount;
}
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, const MWWorld::Ptr& actor, bool fireEvent)
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, const MWWorld::Ptr& actor, bool applyUpdates)
{
if (slot<0 || slot>=static_cast<int> (mSlots.size()))
throw std::runtime_error ("slot number out of range");
@ -794,10 +794,11 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c
}
}
if (fireEvent)
if (applyUpdates)
{
fireEquipmentChangedEvent(actor);
updateMagicEffects(actor);
updateMagicEffects(actor);
}
return retval;
}

@ -173,7 +173,7 @@ namespace MWWorld
///
/// @return the number of items actually removed
ContainerStoreIterator unequipSlot(int slot, const Ptr& actor, bool fireEvent=true);
ContainerStoreIterator unequipSlot(int slot, const Ptr& actor, bool applyUpdates = true);
///< Unequip \a slot.
///
/// @return an iterator to the item that was previously in the slot

Loading…
Cancel
Save