[Client] Update 3rd person model of local player when unequipping

This had apparently been broken by the fact that I had made inventory listeners get run only for actors in active cells in 385ef55848. Strangely, the player Ptr passed to fireEquipmentChangedEvent() when unequipping items has as its cell the player's original spawn cell instead of the current cell, causing the active cell check to return false in most locations for the player.
pull/593/head
David Cernat 3 years ago
parent de78b65eb0
commit 1ba36076f3

@ -919,10 +919,15 @@ void MWWorld::InventoryStore::fireEquipmentChangedEvent(const Ptr& actor)
/*
Start of tes3mp change (major)
Only fire inventory events for actors in loaded cells to avoid crashes
Only fire inventory events for local players or for other actors in loaded cells to avoid crashes
*/
if (mInventoryListener && MWBase::Environment::get().getWorld()->isCellActive(*actor.getCell()->getCell()))
if (mInventoryListener)
{
if (actor == MWMechanics::getPlayer() || MWBase::Environment::get().getWorld()->isCellActive(*actor.getCell()->getCell()))
{
mInventoryListener->equipmentChanged();
}
}
/*
End of tes3mp change (major)
*/

Loading…
Cancel
Save