Enchanting: cast the enchant points for the item to int (Fixes #2202)

This commit is contained in:
scrawl 2014-12-10 17:30:33 +01:00
parent 3c747195ae
commit ead6bf1601
2 changed files with 5 additions and 5 deletions

View file

@ -156,7 +156,7 @@ namespace MWMechanics
* *
* Formula on UESPWiki is not entirely correct. * Formula on UESPWiki is not entirely correct.
*/ */
float Enchanting::getEnchantPoints() const int Enchanting::getEnchantPoints() const
{ {
if (mEffectList.mList.empty()) if (mEffectList.mList.empty())
// No effects added, cost = 0 // No effects added, cost = 0
@ -195,7 +195,7 @@ namespace MWMechanics
--effectsLeftCnt; --effectsLeftCnt;
} }
return enchantmentCost; return static_cast<int>(enchantmentCost);
} }
@ -240,7 +240,7 @@ namespace MWMechanics
return soul->mData.mSoul; return soul->mData.mSoul;
} }
float Enchanting::getMaxEnchantValue() const int Enchanting::getMaxEnchantValue() const
{ {
if (itemEmpty()) if (itemEmpty())
return 0; return 0;

View file

@ -35,10 +35,10 @@ namespace MWMechanics
bool create(); //Return true if created, false if failed. bool create(); //Return true if created, false if failed.
void nextCastStyle(); //Set enchant type to next possible type (for mOldItemPtr object) void nextCastStyle(); //Set enchant type to next possible type (for mOldItemPtr object)
int getCastStyle() const; int getCastStyle() const;
float getEnchantPoints() const; int getEnchantPoints() const;
float getCastCost() const; float getCastCost() const;
int getEnchantPrice() const; int getEnchantPrice() const;
float getMaxEnchantValue() const; int getMaxEnchantValue() const;
int getGemCharge() const; int getGemCharge() const;
float getEnchantChance() const; float getEnchantChance() const;
bool soulEmpty() const; //Return true if empty bool soulEmpty() const; //Return true if empty