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

[Client] Fix autoequipping for creatures in WorldEvent::editContainers()

This commit is contained in:
David Cernat 2018-04-03 15:22:51 +03:00
parent a86c68c5a1
commit 0eed05610b

View file

@ -80,7 +80,7 @@ void WorldEvent::addContainerItem(mwmp::WorldObject& worldObject, const MWWorld:
containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge(); containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge();
containerItem.actionCount = actionCount; containerItem.actionCount = actionCount;
LOG_APPEND(Log::LOG_INFO, "- Adding container item %s", containerItem.refId.c_str()); LOG_APPEND(Log::LOG_INFO, "-- Adding container item %s", containerItem.refId.c_str());
worldObject.containerItems.push_back(containerItem); worldObject.containerItems.push_back(containerItem);
} }
@ -232,7 +232,12 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore)
mwmp::Main::get().getCellController()->isLocalActor(ptrFound)) mwmp::Main::get().getCellController()->isLocalActor(ptrFound))
{ {
MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound); MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound);
if (ptrFound.getTypeName() == typeid(ESM::NPC).name())
invStore.autoEquip(ptrFound); invStore.autoEquip(ptrFound);
// autoEquip only works on NPCs, so use the closest alternative for creatures
else
invStore.autoEquipShield(ptrFound);
} }
// If this container was open for us, update its view // If this container was open for us, update its view