From f8c07ca9dc6ff1aaa2ff74064f7d69365a9266de Mon Sep 17 00:00:00 2001 From: capostrophic Date: Tue, 30 Jul 2019 22:07:55 +0300 Subject: [PATCH] Don't "jump" with 0 vertical velocity in all cases (bug #5106) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/character.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29e310b58..84d72a5b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ Bug #5093: Hand to hand sound plays on knocked out enemies Bug #5099: Non-swimming enemies will enter water if player is water walking Bug #5105: NPCs start combat with werewolves from any distance + Bug #5106: Still can jump even when encumbered Bug #5110: ModRegion with a redundant numerical argument breaks script execution Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 00b3c0c67..b394e91c2 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2065,7 +2065,8 @@ void CharacterController::update(float duration, bool animationOnly) cls.getCreatureStats(mPtr).setFatigue(fatigue); } - if(sneak || inwater || flying || incapacitated || !solid) + float z = cls.getJump(mPtr); + if(sneak || inwater || flying || incapacitated || !solid || z <= 0) vec.z() = 0.0f; bool inJump = true; @@ -2088,7 +2089,6 @@ void CharacterController::update(float duration, bool animationOnly) else if(vec.z() > 0.0f && mJumpState != JumpState_InAir) { // Started a jump. - float z = cls.getJump(mPtr); if (z > 0) { if(vec.x() == 0 && vec.y() == 0)