Don't "jump" with 0 vertical velocity in all cases (bug #5106)

pull/2458/head
capostrophic 5 years ago
parent 56c9c72bc7
commit f8c07ca9dc

@ -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

@ -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)

Loading…
Cancel
Save