forked from teamnwah/openmw-tes3coop
npc swap cheaper ring during auto equip
This commit is contained in:
parent
e6e482ea98
commit
ff9cb22a58
1 changed files with 12 additions and 2 deletions
|
@ -321,13 +321,23 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
|
|||
else if (iter.getType() == ContainerStore::Type_Clothing)
|
||||
{
|
||||
// if left ring is equipped
|
||||
if (*iter2 == MWWorld::InventoryStore::Slot_LeftRing)
|
||||
if (*iter2 == Slot_LeftRing)
|
||||
{
|
||||
// if there is a place for right ring dont swap left leaving right hand empty
|
||||
if (slots_.at(MWWorld::InventoryStore::Slot_RightRing) == end())
|
||||
if (slots_.at(Slot_RightRing) == end())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else // if right ring is equipped too
|
||||
{
|
||||
Ptr rightRing = *slots_.at(Slot_RightRing);
|
||||
|
||||
// we want to swap cheaper ring only if both are equipped
|
||||
if (rightRing.getClass().getValue(rightRing) < old.getClass().getValue(old))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (old.getTypeName() == typeid(ESM::Clothing).name())
|
||||
|
|
Loading…
Reference in a new issue