From 0bef75487366b786c3db147181ea009f8649b86b Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 13 Apr 2014 08:46:02 +1000 Subject: [PATCH] Fix jumping animation glitches caused by minor vertical movements. Should resolve Bug #1271. --- apps/openmw/mwmechanics/character.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 93c789af1..b7d99adec 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1090,7 +1090,13 @@ void CharacterController::update(float duration) if (inwater || flying) cls.getCreatureStats(mPtr).land(); - if(!onground && !flying && !inwater) + // FIXME: The check for vec.z is a hack, but onground is not a reliable + // indicator of whether the actor is on the ground (defaults to false, which + // means this code block will always execute at least once for most, and + // collisions can move z position slightly off zero). A very small value of + // 0.1 is used here, but maybe something larger like 10 should be used. + // Should resolve Bug#1271. + if(!onground && !flying && !inwater && vec.z > 0.1f) { // In the air (either getting up —ascending part of jump— or falling).