npc swap cheaper ring during auto equip

new-script-api
glbwsk 7 years ago
parent e6e482ea98
commit ff9cb22a58

@ -321,13 +321,23 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
else if (iter.getType() == ContainerStore::Type_Clothing) else if (iter.getType() == ContainerStore::Type_Clothing)
{ {
// if left ring is equipped // 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 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; 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()) if (old.getTypeName() == typeid(ESM::Clothing).name())

Loading…
Cancel
Save