forked from mirror/openmw-tes3mp
Ignore encumbrance in werewolf form
According to UESP, inventory weight is ignored. Not sure if this includes feather and burden effects.
This commit is contained in:
parent
180f0d0fe9
commit
00d6690b4d
1 changed files with 12 additions and 9 deletions
|
@ -841,16 +841,19 @@ namespace MWClass
|
||||||
|
|
||||||
float Npc::getEncumbrance (const MWWorld::Ptr& ptr) const
|
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);
|
|
||||||
|
|
||||||
|
// 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::Feather)).mMagnitude;
|
||||||
|
|
||||||
weight += stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Burden)).mMagnitude;
|
weight += stats.getMagicEffects().get(MWMechanics::EffectKey(ESM::MagicEffect::Burden)).mMagnitude;
|
||||||
|
if(weight < 0.0f)
|
||||||
if (weight<0)
|
weight = 0.0f;
|
||||||
weight = 0;
|
}
|
||||||
|
|
||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue