mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 02:45:32 +00:00
Fifth minor fix
This commit is contained in:
parent
248fff6eb7
commit
bd93e63150
1 changed files with 12 additions and 12 deletions
|
@ -21,6 +21,18 @@ namespace MWWorld
|
||||||
MWWorld::Ptr object = getTarget();
|
MWWorld::Ptr object = getTarget();
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
|
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
|
// slots that this item can be equipped in
|
||||||
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget());
|
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget());
|
||||||
|
|
||||||
|
@ -40,18 +52,6 @@ namespace MWWorld
|
||||||
|
|
||||||
bool equipped = false;
|
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
|
// equip the item in the first free slot
|
||||||
for (std::vector<int>::const_iterator slot=slots.first.begin();
|
for (std::vector<int>::const_iterator slot=slots.first.begin();
|
||||||
slot!=slots.first.end(); ++slot)
|
slot!=slots.first.end(); ++slot)
|
||||||
|
|
Loading…
Reference in a new issue