1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Fix skill progress not working

This commit is contained in:
scrawl 2014-01-13 07:05:52 +01:00
parent cd06b2177d
commit 73268a8606
3 changed files with 14 additions and 2 deletions

View file

@ -185,7 +185,7 @@ namespace MWGui
MyGUI::TextBox* widget = mSkillWidgetMap[(int)parSkill]; MyGUI::TextBox* widget = mSkillWidgetMap[(int)parSkill];
if (widget) if (widget)
{ {
float modified = value.getModified(), base = value.getBase(); int modified = value.getModified(), base = value.getBase();
std::string text = boost::lexical_cast<std::string>(std::floor(modified)); std::string text = boost::lexical_cast<std::string>(std::floor(modified));
std::string state = "normal"; std::string state = "normal";
if (modified > base) if (modified > base)

View file

@ -207,7 +207,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
if(mIsWerewolf) if(mIsWerewolf)
return; return;
MWMechanics::SkillValue value = getSkill (skillIndex); MWMechanics::SkillValue& value = getSkill (skillIndex);
value.setProgress(value.getProgress() + getSkillGain (skillIndex, class_, usageType)); value.setProgress(value.getProgress() + getSkillGain (skillIndex, class_, usageType));

View file

@ -246,6 +246,18 @@ namespace MWMechanics
{ {
return !(left == right); return !(left == right);
} }
inline bool operator== (const SkillValue& left, const SkillValue& right)
{
return left.getBase() == right.getBase()
&& left.getModifier() == right.getModifier()
&& left.getDamage() == right.getDamage()
&& left.getProgress() == right.getProgress();
}
inline bool operator!= (const SkillValue& left, const SkillValue& right)
{
return !(left == right);
}
} }
#endif #endif