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

pull/402/head
David Cernat 7 years ago
parent a86c68c5a1
commit 0eed05610b

@ -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

Loading…
Cancel
Save