[Client] Require InventoryStore for autoequipping actors

0.6.3
David Cernat 7 years ago
parent afe8c97cb9
commit 258e319acb

@ -84,6 +84,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore)
// ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum());
bool isCurrentContainer = false;
bool hasActorEquipment = ptrFound.getClass().isActor() && ptrFound.getClass().hasInventoryStore(ptrFound);
// If we are in a container, and it happens to be this container, keep track of that
if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Container))
@ -151,7 +152,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore)
takeAllSound = itemPtr.getClass().getUpSoundId(itemPtr);
// Is this an actor's container? If so, unequip this item if it was equipped
if (ptrFound.getClass().isActor() && ptrFound.getClass().hasInventoryStore(ptrFound))
if (hasActorEquipment)
{
MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound);
@ -190,7 +191,7 @@ void WorldEvent::editContainers(MWWorld::CellStore* cellStore)
// Was this a SET or ADD action on an actor's container, and are we the authority
// over the actor? If so, autoequip the actor
if ((action == BaseEvent::ADD || action == BaseEvent::SET) && ptrFound.getClass().isActor() &&
if ((action == BaseEvent::ADD || action == BaseEvent::SET) && hasActorEquipment &&
mwmp::Main::get().getCellController()->isLocalActor(ptrFound))
{
MWWorld::InventoryStore& invStore = ptrFound.getClass().getInventoryStore(ptrFound);

Loading…
Cancel
Save