|
|
|
@ -291,8 +291,15 @@ namespace MWScript
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
|
|
|
|
.getDynamic (mIndex));
|
|
|
|
|
|
|
|
|
|
// for fatigue, a negative current value is allowed and means the actor will be knocked down
|
|
|
|
|
bool allowDecreaseBelowZero = (mIndex == 2);
|
|
|
|
|
bool allowDecreaseBelowZero = false;
|
|
|
|
|
if (mIndex == 2) // Fatigue-specific logic
|
|
|
|
|
{
|
|
|
|
|
// For fatigue, a negative current value is allowed and means the actor will be knocked down
|
|
|
|
|
allowDecreaseBelowZero = true;
|
|
|
|
|
// Knock down the actor immediately if a non-positive new value is the case
|
|
|
|
|
if (diff + current <= 0.f)
|
|
|
|
|
ptr.getClass().getCreatureStats(ptr).setKnockedDown(true);
|
|
|
|
|
}
|
|
|
|
|
stat.setCurrent (diff + current, allowDecreaseBelowZero);
|
|
|
|
|
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|