From 9fe5a4d236d5f3e5d3f3214be6beb2e400b9e43e Mon Sep 17 00:00:00 2001 From: Grigorii Latyshev Date: Tue, 28 Nov 2017 17:04:37 +0100 Subject: [PATCH] Revert condition changes --- apps/openmw/mwmechanics/spellcasting.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 5cab750db..63fe3fa3c 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -126,10 +126,7 @@ namespace MWMechanics float castChance = calcSpellBaseSuccessChance(spell, actor, effectiveSchool) + castBonus; castChance *= stats.getFatigueTerm(); - if (godmode) - return 100; - - if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude()) + if (stats.getMagicEffects().get(ESM::MagicEffect::Silence).getMagnitude()&& !godmode) return 0; if (spell->mData.mType == ESM::Spell::ST_Power) @@ -138,12 +135,17 @@ namespace MWMechanics if (spell->mData.mType != ESM::Spell::ST_Spell) return 100; - if (stats.getMagicka().getCurrent() < spell->mData.mCost) + if (stats.getMagicka().getCurrent() < spell->mData.mCost && !godmode) return 0; if (spell->mData.mFlags & ESM::Spell::F_Always) return 100; + if (godmode) + { + return 100; + } + if (!cap) return std::max(0.f, castChance); else