Fix an auto equipping bug that allowed twohanded weapon and shield at the same time

This commit is contained in:
scrawl 2014-01-11 03:07:35 +01:00
parent d4a98ffc27
commit 12944f2459

View file

@ -165,7 +165,6 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::getSlot (int slot)
void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
{ {
const MWMechanics::NpcStats& stats = MWWorld::Class::get(actor).getNpcStats(actor); const MWMechanics::NpcStats& stats = MWWorld::Class::get(actor).getNpcStats(actor);
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
TSlots slots_; TSlots slots_;
initSlots (slots_); initSlots (slots_);
@ -266,10 +265,10 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
case 0: case 0:
continue; continue;
case 2: case 2:
invStore.unequipSlot(MWWorld::InventoryStore::Slot_CarriedLeft, actor); slots_[MWWorld::InventoryStore::Slot_CarriedLeft] = end();
break; break;
case 3: case 3:
invStore.unequipSlot(MWWorld::InventoryStore::Slot_CarriedRight, actor); // Prefer keeping twohanded weapon
break; break;
} }