From 325ea1059438f2eb9f587f300032638953e511f7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 25 Jul 2017 10:28:33 +0400 Subject: [PATCH] Fixed encumberance check (bug #3963) --- apps/openmw/mwmechanics/character.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 5981a79c9..c1eb2d056 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1673,9 +1673,10 @@ void CharacterController::update(float duration) static const float fFatigueSneakBase = gmst.find("fFatigueSneakBase")->getFloat(); static const float fFatigueSneakMult = gmst.find("fFatigueSneakMult")->getFloat(); - const float encumbrance = cls.getEncumbrance(mPtr) / cls.getCapacity(mPtr); - if (encumbrance < 1) + if (cls.getEncumbrance(mPtr) <= cls.getCapacity(mPtr)) { + const float encumbrance = cls.getEncumbrance(mPtr) / cls.getCapacity(mPtr); + if (sneak) fatigueLoss = fFatigueSneakBase + encumbrance * fFatigueSneakMult; else