From 4e17bc1499e64fd9aee851b9dc91a3a606b261a2 Mon Sep 17 00:00:00 2001 From: Miroslav Puda Date: Mon, 27 May 2013 20:16:57 +0200 Subject: [PATCH] Fix for display of cast cost decimal value --- apps/openmw/mwgui/enchantingdialog.cpp | 4 +++- apps/openmw/mwmechanics/enchanting.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index 8353cf99e..7f71716ed 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -66,7 +66,9 @@ namespace MWGui mCharge->setCaption(boost::lexical_cast(mEnchanting.getGemCharge())); - mCastCost->setCaption(boost::lexical_cast(mEnchanting.getCastCost())); + std::stringstream castCost; + castCost << std::setprecision(1) << std::fixed << mEnchanting.getCastCost(); + mCastCost->setCaption(boost::lexical_cast(castCost.str())); mPrice->setCaption(boost::lexical_cast(mEnchanting.getEnchantPrice())); diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 95d7694dc..821df8fba 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -209,6 +209,9 @@ namespace MWMechanics float Enchanting::getCastCost() const { + if (mCastStyle == ESM::CS_ConstantEffect) + return 0; + const float enchantCost = getEnchantCost(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWMechanics::NpcStats &stats = MWWorld::Class::get(player).getNpcStats(player);