From bc60421615177ac15893e58d53e2cca2307704ae Mon Sep 17 00:00:00 2001 From: Allofich Date: Thu, 16 Feb 2017 22:41:19 +0900 Subject: [PATCH] Change NPC equip logic to be more like original (Bug #3754) --- apps/openmw/mwworld/inventorystore.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 54b32d600..f33ddc94f 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -291,9 +291,15 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) { if (old.getTypeName() == typeid(ESM::Armor).name()) { - if (old.getClass().getEffectiveArmorRating(old, actor) >= test.getClass().getEffectiveArmorRating(test, actor)) - // old armor had better armor rating + if (old.get()->mBase->mData.mType < test.get()->mBase->mData.mType) continue; + + if (old.get()->mBase->mData.mType == test.get()->mBase->mData.mType) + { + if (old.getClass().getEffectiveArmorRating(old, actor) >= test.getClass().getEffectiveArmorRating(test, actor)) + // old armor had better armor rating + continue; + } } // suitable armor should replace already equipped clothing }