mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Do not allow decrease below zero in modCurrentMagicka and modCurrentHealth (Fixes #2158)
This commit is contained in:
parent
0a466ad643
commit
d7220cdc2f
1 changed files with 3 additions and 1 deletions
|
@ -278,7 +278,9 @@ namespace MWScript
|
|||
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
||||
.getDynamic (mIndex));
|
||||
|
||||
stat.setCurrent (diff + current, true);
|
||||
// for fatigue, a negative current value is allowed and means the actor will be knocked down
|
||||
bool allowDecreaseBelowZero = (mIndex == 2);
|
||||
stat.setCurrent (diff + current, allowDecreaseBelowZero);
|
||||
|
||||
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue