mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 11:23:52 +00:00
Issue #324: added some range checks
This commit is contained in:
parent
67c1c5ce18
commit
a207c86fd1
1 changed files with 5 additions and 0 deletions
|
@ -280,6 +280,11 @@ namespace MWScript
|
||||||
|
|
||||||
int newLevel = static_cast<int> (value-modifier);
|
int newLevel = static_cast<int> (value-modifier);
|
||||||
|
|
||||||
|
if (newLevel<0)
|
||||||
|
newLevel = 0;
|
||||||
|
else if (newLevel>100)
|
||||||
|
newLevel = 100;
|
||||||
|
|
||||||
progress = (progress / stats.getSkillGain (mIndex, class_, -1, level))
|
progress = (progress / stats.getSkillGain (mIndex, class_, -1, level))
|
||||||
* stats.getSkillGain (mIndex, class_, -1, newLevel);
|
* stats.getSkillGain (mIndex, class_, -1, newLevel);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue