From 00d6690b4db07d898c445439d790339694bba670 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 10 Aug 2013 20:25:18 -0700 Subject: [PATCH] Ignore encumbrance in werewolf form According to UESP, inventory weight is ignored. Not sure if this includes feather and burden effects. --- apps/openmw/mwclass/npc.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index d8b3eeaed..62c6d4744 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -841,16 +841,19 @@ namespace MWClass float Npc::getEncumbrance (const MWWorld::Ptr& ptr) const { - float weight = getContainerStore (ptr).getWeight(); + const MWMechanics::NpcStats &stats = getNpcStats(ptr); - const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); - - weight -= stats.getMagicEffects().get (MWMechanics::EffectKey (ESM::MagicEffect::Feather)).mMagnitude; - - weight += stats.getMagicEffects().get (MWMechanics::EffectKey (ESM::MagicEffect::Burden)).mMagnitude; - - if (weight<0) - weight = 0; + // According to UESP, inventory weight is ignored in werewolf form. Does that include + // feather and burden effects? + float weight = 0.0f; + if(!stats.isWerewolf()) + { + weight = getContainerStore(ptr).getWeight(); + weight -= stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Feather)).mMagnitude; + weight += stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Burden)).mMagnitude; + if(weight < 0.0f) + weight = 0.0f; + } return weight; }