mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-31 04:36:45 +00:00
[Client] Always use autoEquip on newly initialized LocalActors
Previously, it was possible for a Container packet to clear all equipment slots for an actor without the actor's authority then sending an equipment packet to correct that, due to packet loss or sudden disconnection, leading to actors not wearing any equipment as soon as they acquired a new authority. This ensures that newly initialized LocalActors will now autoEquip.
This commit is contained in:
parent
cd444f8707
commit
1950748dae
1 changed files with 7 additions and 2 deletions
|
@ -201,11 +201,16 @@ void LocalActor::updateEquipment(bool forceUpdate, bool sendImmediately)
|
|||
if (!ptr.getClass().hasInventoryStore(ptr))
|
||||
return;
|
||||
|
||||
MWWorld::InventoryStore &invStore = ptr.getClass().getInventoryStore(ptr);
|
||||
|
||||
// If we've never sent any data, autoEquip the actor just in case its inventory
|
||||
// slots have been cleared by a previous Container packet
|
||||
if (!hasSentData)
|
||||
invStore.autoEquip(ptr);
|
||||
|
||||
if (forceUpdate)
|
||||
equipmentChanged = true;
|
||||
|
||||
MWWorld::InventoryStore &invStore = ptr.getClass().getInventoryStore(ptr);
|
||||
|
||||
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; slot++)
|
||||
{
|
||||
auto &item = equipmentItems[slot];
|
||||
|
|
Loading…
Reference in a new issue