Do not allow decrease below zero in modCurrentMagicka and modCurrentHealth (Fixes #2158)

loadfix
scrawl 10 years ago
parent 0a466ad643
commit d7220cdc2f

@ -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…
Cancel
Save