From 9346a552fa1808372899602b1f3eb7125bcde6b3 Mon Sep 17 00:00:00 2001 From: declan-millar Date: Mon, 21 May 2018 13:59:20 +0100 Subject: [PATCH] Use Rebalance soulgem values option to set soulgem value --- apps/openmw/mwclass/misc.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index d2f5d35ba..8e39b44e9 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -1,6 +1,7 @@ #include "misc.hpp" #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -84,18 +85,22 @@ namespace MWClass if (ptr.getCellRef().getSoul() != "") { const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get().search(ref->mRef.getSoul()); - if (creature) { - // value *= creature->mData.mSoul; - - // use soulgem value rebalance formula from morrowind code patch - int soul = creature->mData.mSoul; - float soulValue = 0.0001 * pow(soul, 3) + 2 * soul; - - // for Azura's star add the unfilled value - if (Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "Misc_SoulGem_Azura")) - value += soulValue; + if (creature) + { + if (Settings::Manager::getBool("rebalance soulgem values", "Game")) + { + // use soulgem value rebalance formula from morrowind code patch + int soul = creature->mData.mSoul; + float soulValue = 0.0001 * pow(soul, 3) + 2 * soul; + + // for Azura's star add the unfilled value + if (Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "Misc_SoulGem_Azura")) + value += soulValue; + else + value = soulValue; + } else - value = soulValue; + value *= creature->mData.mSoul; } }