mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Fix being able to jump when overencumbered
This commit is contained in:
parent
e6c59f5585
commit
14ae6d28b0
@ -969,6 +969,9 @@ namespace MWClass
|
||||
|
||||
float Npc::getJump(const MWWorld::Ptr &ptr) const
|
||||
{
|
||||
if(getEncumbrance(ptr) > getCapacity(ptr))
|
||||
return 0.f;
|
||||
|
||||
const NpcCustomData *npcdata = static_cast<const NpcCustomData*>(ptr.getRefData().getCustomData());
|
||||
const GMST& gmst = getGmst();
|
||||
const MWMechanics::MagicEffects &mageffects = npcdata->mNpcStats.getMagicEffects();
|
||||
|
@ -371,6 +371,7 @@ namespace MWInput
|
||||
{
|
||||
mPlayer->setUpDown (1);
|
||||
triedToMove = true;
|
||||
mOverencumberedMessageDelay = 0.f;
|
||||
}
|
||||
|
||||
if (mAlwaysRunActive)
|
||||
|
@ -1414,6 +1414,8 @@ void CharacterController::update(float duration)
|
||||
{
|
||||
// Started a jump.
|
||||
float z = cls.getJump(mPtr);
|
||||
if (z > 0)
|
||||
{
|
||||
if(vec.x == 0 && vec.y == 0)
|
||||
vec = Ogre::Vector3(0.0f, 0.0f, z);
|
||||
else
|
||||
@ -1438,6 +1440,7 @@ void CharacterController::update(float duration)
|
||||
fatigue.setCurrent(fatigue.getCurrent() - fatigueDecrease);
|
||||
cls.getCreatureStats(mPtr).setFatigue(fatigue);
|
||||
}
|
||||
}
|
||||
else if(mJumpState == JumpState_InAir)
|
||||
{
|
||||
forcestateupdate = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user