Do not allow training skills above their governing attribute

This commit is contained in:
scrawl 2014-01-10 20:53:53 +01:00
parent bfdca3b738
commit 627dcddb33

View file

@ -130,6 +130,14 @@ namespace MWGui
return;
}
// You can not train a skill above its governing attribute
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>().find(skillId);
if (pcStats.getSkill(skillId).getBase() >= pcStats.getAttribute(skill->mData.mAttribute).getBase())
{
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage17}");
return;
}
// increase skill
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();