mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-10 15:04:29 +00:00
Merge branch 'skills_fix' into 'master'
Validate skill level before changing the progress Closes #8779 See merge request OpenMW/openmw!4981
This commit is contained in:
commit
1315d29684
1 changed files with 6 additions and 0 deletions
|
|
@ -132,6 +132,12 @@ local function skillUsedHandler(skillid, params)
|
||||||
end
|
end
|
||||||
|
|
||||||
local skillStat = NPC.stats.skills[skillid](self)
|
local skillStat = NPC.stats.skills[skillid](self)
|
||||||
|
|
||||||
|
if (skillStat.base >= 100 and params.skillGain > 0) or
|
||||||
|
(skillStat.base <= 0 and params.skillGain < 0) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
skillStat.progress = skillStat.progress + params.skillGain / I.SkillProgression.getSkillProgressRequirement(skillid)
|
skillStat.progress = skillStat.progress + params.skillGain / I.SkillProgression.getSkillProgressRequirement(skillid)
|
||||||
|
|
||||||
if skillStat.progress >= 1 then
|
if skillStat.progress >= 1 then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue