1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Fifth minor fix

This commit is contained in:
Glorf 2013-04-09 19:46:27 +02:00
parent 248fff6eb7
commit bd93e63150

View File

@ -21,6 +21,18 @@ namespace MWWorld
MWWorld::Ptr object = getTarget();
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
switch(MWWorld::Class::get (object).canBeEquipped (actor, object))
{
case 0:
return;
case 2:
invStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, invStore.end());
break;
case 3:
invStore.equip(MWWorld::InventoryStore::Slot_CarriedRight, invStore.end());
break;
}
// slots that this item can be equipped in
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget());
@ -40,18 +52,6 @@ namespace MWWorld
bool equipped = false;
switch(MWWorld::Class::get (object).canBeEquipped (actor, object))
{
case 0:
return;
case 2:
invStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, invStore.end());
break;
case 3:
invStore.equip(MWWorld::InventoryStore::Slot_CarriedRight, invStore.end());
break;
}
// equip the item in the first free slot
for (std::vector<int>::const_iterator slot=slots.first.begin();
slot!=slots.first.end(); ++slot)