Fix for display of cast cost decimal value

This commit is contained in:
Miroslav Puda 2013-05-27 20:16:57 +02:00
parent 9a9b075a02
commit 4e17bc1499
2 changed files with 6 additions and 1 deletions

View file

@ -66,7 +66,9 @@ namespace MWGui
mCharge->setCaption(boost::lexical_cast<std::string>(mEnchanting.getGemCharge()));
mCastCost->setCaption(boost::lexical_cast<std::string>(mEnchanting.getCastCost()));
std::stringstream castCost;
castCost << std::setprecision(1) << std::fixed << mEnchanting.getCastCost();
mCastCost->setCaption(boost::lexical_cast<std::string>(castCost.str()));
mPrice->setCaption(boost::lexical_cast<std::string>(mEnchanting.getEnchantPrice()));

View file

@ -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);