From 6aa56354c0eaba9f7c6a2aa4a892cc8d65f8832e Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 14 Jan 2014 05:24:58 +0100 Subject: [PATCH] Revert "Bug #991: Don't autoequip items with harmful permanent enchantments" This is no longer needed, since merchants no longer equip items sold to them (2f35e5a04ef828d4e99e28e0be74b175c766d13d). Also, items with harmful enchantments that are initially in the NPCs inventory *must* be equipped (e.g. slave bracers) This reverts commit 71d9755ef167a25ea3ce8098325b44e0811b6bf8. --- apps/openmw/mwworld/inventorystore.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 3e81da212..e8938b2c0 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -195,29 +195,6 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) std::pair, bool> itemsSlots = MWWorld::Class::get (*iter).getEquipmentSlots (*iter); - // Skip items that have *only* harmful permanent effects - if (!test.getClass().getEnchantment(test).empty()) - { - const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); - const ESM::Enchantment* enchantment = store.get().find(test.getClass().getEnchantment(test)); - bool harmfulEffect = false; - bool usefulEffect = false; - if (enchantment->mData.mType == ESM::Enchantment::ConstantEffect) - { - for (std::vector::const_iterator it = enchantment->mEffects.mList.begin(); - it != enchantment->mEffects.mList.end(); ++it) - { - const ESM::MagicEffect* effect = store.get().find(it->mEffectID); - if (effect->mData.mFlags & ESM::MagicEffect::Harmful) - harmfulEffect = true; - else - usefulEffect = true; - } - } - if (harmfulEffect && !usefulEffect) - continue; - } - for (std::vector::const_iterator iter2 (itemsSlots.first.begin()); iter2!=itemsSlots.first.end(); ++iter2) {