Fix skill progress not working

actorid
scrawl 11 years ago
parent cd06b2177d
commit 73268a8606

@ -185,7 +185,7 @@ namespace MWGui
MyGUI::TextBox* widget = mSkillWidgetMap[(int)parSkill];
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 state = "normal";
if (modified > base)

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

@ -246,6 +246,18 @@ namespace MWMechanics
{
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

Loading…
Cancel
Save