From d7220cdc2fd45f196467aed8ee4fbe23741df211 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 28 Nov 2014 14:48:03 +0100 Subject: [PATCH] Do not allow decrease below zero in modCurrentMagicka and modCurrentHealth (Fixes #2158) --- apps/openmw/mwscript/statsextensions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index befb8d82ea..d5647db10d 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -278,7 +278,9 @@ namespace MWScript MWMechanics::DynamicStat 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); }