1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

[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.
This commit is contained in:
David Cernat 2021-10-01 03:09:14 +02:00
parent de78b65eb0
commit 1ba36076f3

View file

@ -919,10 +919,15 @@ void MWWorld::InventoryStore::fireEquipmentChangedEvent(const Ptr& actor)
/* /*
Start of tes3mp change (major) 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)
mInventoryListener->equipmentChanged(); {
if (actor == MWMechanics::getPlayer() || MWBase::Environment::get().getWorld()->isCellActive(*actor.getCell()->getCell()))
{
mInventoryListener->equipmentChanged();
}
}
/* /*
End of tes3mp change (major) End of tes3mp change (major)
*/ */