From 44ef02eb99c2cf7f4cab6d60320e155fe5183579 Mon Sep 17 00:00:00 2001 From: Glorf Date: Tue, 9 Apr 2013 19:04:59 +0200 Subject: [PATCH] Third minor fix --- apps/openmw/mwworld/actionequip.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwworld/actionequip.cpp b/apps/openmw/mwworld/actionequip.cpp index 82431ac8f..2877a2c5a 100644 --- a/apps/openmw/mwworld/actionequip.cpp +++ b/apps/openmw/mwworld/actionequip.cpp @@ -40,19 +40,20 @@ namespace MWWorld bool equipped = false; + switch(MWWorld::Class::get (object).canBeEquipped (actor, object)) + { + case 0: + return; //Item cannot be equipped, so function breaks. + case 2: + invStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, invStore.end()); + case 3: + invStore.equip(MWWorld::InventoryStore::Slot_CarriedRight, invStore.end()); + } + // equip the item in the first free slot for (std::vector::const_iterator slot=slots.first.begin(); slot!=slots.first.end(); ++slot) { - switch(MWWorld::Class::get (object).canBeEquipped (actor, object)) - { - case 0: - return; - case 2: - invStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, invStore.end()); - case 3: - invStore.equip(MWWorld::InventoryStore::Slot_CarriedRight, invStore.end()); - } // if all slots are occupied, replace the last slot if (slot == --slots.first.end())