From a9a0930b855b76ef6af00ce01e3f163c7f880b33 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Wed, 1 Oct 2014 19:24:54 -0500 Subject: [PATCH] Disease check: Reuse corprus check from spells.hpp. --- apps/openmw/mwmechanics/disease.hpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/openmw/mwmechanics/disease.hpp b/apps/openmw/mwmechanics/disease.hpp index fa97f15417..21dd820546 100644 --- a/apps/openmw/mwmechanics/disease.hpp +++ b/apps/openmw/mwmechanics/disease.hpp @@ -33,18 +33,8 @@ namespace MWMechanics if (actor.getClass().getCreatureStats(actor).getSpells().hasSpell(spell->mId)) continue; - bool hasCorprusEffect = false; - for (std::vector::const_iterator effectIt = spell->mEffects.mList.begin(); effectIt != spell->mEffects.mList.end(); ++effectIt) - { - if (effectIt->mEffectID == ESM::MagicEffect::Corprus) - { - hasCorprusEffect = true; - break; - } - } - float resist = 0.f; - if (hasCorprusEffect) + if (spells.hasCorprusEffect(spell)) resist = 1.f - 0.01 * (actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::ResistCorprusDisease).getMagnitude() - actor.getClass().getCreatureStats(actor).getMagicEffects().get(ESM::MagicEffect::WeaknessToCorprusDisease).getMagnitude()); else if (spell->mData.mType == ESM::Spell::ST_Disease)