Merged pull request #4413

pull/438/head
Marc Zinnschlag 7 years ago
commit 2f958881b7

@ -988,7 +988,7 @@ namespace MWClass
const MWMechanics::MagicEffects &mageffects = npcdata->mNpcStats.getMagicEffects(); const MWMechanics::MagicEffects &mageffects = npcdata->mNpcStats.getMagicEffects();
const float encumbranceTerm = gmst.fJumpEncumbranceBase->getFloat() + const float encumbranceTerm = gmst.fJumpEncumbranceBase->getFloat() +
gmst.fJumpEncumbranceMultiplier->getFloat() * gmst.fJumpEncumbranceMultiplier->getFloat() *
(1.0f - Npc::getEncumbrance(ptr)/Npc::getCapacity(ptr)); (1.0f - Npc::getNormalizedEncumbrance(ptr));
float a = static_cast<float>(npcdata->mNpcStats.getSkill(ESM::Skill::Acrobatics).getModified()); float a = static_cast<float>(npcdata->mNpcStats.getSkill(ESM::Skill::Acrobatics).getModified());
float b = 0.0f; float b = 0.0f;

@ -1751,8 +1751,7 @@ void CharacterController::update(float duration)
if (cls.getEncumbrance(mPtr) <= cls.getCapacity(mPtr)) if (cls.getEncumbrance(mPtr) <= cls.getCapacity(mPtr))
{ {
const float encumbrance = cls.getEncumbrance(mPtr) / cls.getCapacity(mPtr); const float encumbrance = cls.getNormalizedEncumbrance(mPtr);
if (sneak) if (sneak)
fatigueLoss = fFatigueSneakBase + encumbrance * fFatigueSneakMult; fatigueLoss = fFatigueSneakBase + encumbrance * fFatigueSneakMult;
else else

@ -462,10 +462,15 @@ namespace MWWorld
float Class::getNormalizedEncumbrance(const Ptr &ptr) const float Class::getNormalizedEncumbrance(const Ptr &ptr) const
{ {
float capacity = getCapacity(ptr); float capacity = getCapacity(ptr);
float encumbrance = getEncumbrance(ptr);
if (encumbrance == 0)
return 0.f;
if (capacity == 0) if (capacity == 0)
return 1.f; return 1.f;
return getEncumbrance(ptr) / capacity; return encumbrance / capacity;
} }
std::string Class::getSound(const MWWorld::ConstPtr&) const std::string Class::getSound(const MWWorld::ConstPtr&) const

Loading…
Cancel
Save