From e9be6d3f42fa89ef52ca3393e46db66d833e9b0d Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 13 Apr 2014 11:34:59 +1000 Subject: [PATCH] Fix falling animation where vec.z is set to zero. --- apps/openmw/mwmechanics/character.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index b7d99adec..d34812417 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1090,13 +1090,14 @@ void CharacterController::update(float duration) if (inwater || flying) cls.getCreatureStats(mPtr).land(); - // 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) + 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 actors, + // and collisions can move z position slightly off zero). A very small value + // of 0.1 is used here, but something larger like 10 may be more suitable. + // Should resolve Bug#1271. + && (mJumpState == JumpState_Falling || vec.z > 0.1f)) { // In the air (either getting up —ascending part of jump— or falling).