From 663647bee80d5c80263039107911d11659d03523 Mon Sep 17 00:00:00 2001 From: Jordan Ayers Date: Wed, 1 Oct 2014 22:55:21 -0500 Subject: [PATCH] Simplify getEffectMultiplier. Both return cases were same, except for some overflow conditions. --- apps/openmw/mwmechanics/spellcasting.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 373ca7af9..03c30ab15 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -246,10 +246,7 @@ namespace MWMechanics const ESM::Spell* spell, const MagicEffects* effects) { float resistance = getEffectResistance(effectId, actor, caster, spell, effects); - if (resistance >= 0) - return 1 - resistance / 100.f; - else - return -(resistance-100) / 100.f; + return 1 - resistance / 100.f; } /// Check if the given affect can be applied to the target. If \a castByPlayer, emits a message box on failure.