From 1c7b94e94f27df9d8d078db7178109650ccb4cfd Mon Sep 17 00:00:00 2001 From: Miroslav Puda Date: Mon, 27 May 2013 16:08:58 +0200 Subject: [PATCH] Switching in nextCastStyle() is now based on enum CastingStyle. --- apps/openmw/mwmechanics/enchanting.cpp | 49 +++++++++++++++++--------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index c7a67e7cb..25aa0ea64 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -100,38 +100,53 @@ namespace MWMechanics void Enchanting::nextCastStyle() { - mCastStyle++; if (itemEmpty()) { - mCastStyle = 0; + mCastStyle = ESM::CS_WhenUsed; return; } - if ((mObjectType == typeid(ESM::Armor).name())||(mObjectType == typeid(ESM::Clothing).name())) - { - int soulConstAmount = MWBase::Environment::get().getWorld()->getStore().get().find ("iSoulAmountForConstantEffect")->getInt(); + + const bool powerfulSoul = getGemCharge() >= \ + MWBase::Environment::get().getWorld()->getStore().get().find ("iSoulAmountForConstantEffect")->getInt(); + if ((mObjectType == typeid(ESM::Armor).name()) || (mObjectType == typeid(ESM::Clothing).name())) + { // Armor or Clothing switch(mCastStyle) { - case 1: - mCastStyle = 2; - case 3: - if(getGemCharge()