From 3c7ab976c381d661b3ef6a9162da7e1d8c7bc0f7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 27 Jun 2018 08:22:45 +0400 Subject: [PATCH] Ignore movement from scripted animations (bug #4475) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/character.cpp | 2 +- apps/openmw/mwrender/animation.cpp | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8379b6bea..39af121aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Bug #4469: Abot Silt Striders – Model turn 90 degrees on horizontal Bug #4471: Retrieve SDL window settings instead of using magic numbers Bug #4474: No fallback when getVampireHead fails + Bug #4475: Scripted animations should not cause movement Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots Feature #4256: Implement ToggleBorders (TB) console command diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index e2df546cd..c049d7933 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2141,7 +2141,7 @@ void CharacterController::unpersistAnimationState() bool loopfallback = (mAnimQueue.front().mGroup.compare(0,4,"idle") == 0); mAnimation->play(anim.mGroup, - Priority_Default, MWRender::Animation::BlendMask_All, false, 1.0f, + Priority_Persistent, MWRender::Animation::BlendMask_All, false, 1.0f, "start", "stop", complete, anim.mLoopCount, loopfallback); } } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 0d740b2f6..ff31e1cfb 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1190,6 +1190,10 @@ namespace MWRender mHeadController->setRotate(osg::Quat(mHeadPitchRadians, osg::Vec3f(1,0,0)) * osg::Quat(mHeadYawRadians, osg::Vec3f(0,0,1))); } + // Scripted animations should not cause movement + if (hasScriptedAnims) + return osg::Vec3f(0, 0, 0); + return movement; }