From 0eed05610b6ea1d44b9779325b18d38e90beefa1 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 3 Apr 2018 15:22:51 +0300 Subject: [PATCH] [Client] Fix autoequipping for creatures in WorldEvent::editContainers() --- apps/openmw/mwmp/WorldEvent.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmp/WorldEvent.cpp b/apps/openmw/mwmp/WorldEvent.cpp index cae3bcceb..5e5ad23b0 100644 --- a/apps/openmw/mwmp/WorldEvent.cpp +++ b/apps/openmw/mwmp/WorldEvent.cpp @@ -80,7 +80,7 @@ void WorldEvent::addContainerItem(mwmp::WorldObject& worldObject, const MWWorld: containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge(); 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); } @@ -232,7 +232,12 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore) mwmp::Main::get().getCellController()->isLocalActor(ptrFound)) { MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound); - invStore.autoEquip(ptrFound); + + if (ptrFound.getTypeName() == typeid(ESM::NPC).name()) + 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