From 126960261f0c3a6d3b3621a229b00737e2267548 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 16 Sep 2015 16:14:17 +0200 Subject: [PATCH] Keep playing IdleSneak on the lower body when casting spells / using weapons --- apps/openmw/mwmechanics/character.cpp | 3 +++ apps/openmw/mwmechanics/character.hpp | 1 + apps/openmw/mwrender/animation.cpp | 2 +- apps/openmw/mwrender/animation.hpp | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 0d7c0ff26..49e40349b 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -483,7 +483,10 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat idlePriority = Priority_SwimIdle; } else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak")) + { idle = "idlesneak"; + idlePriority[MWRender::Animation::BoneGroup_LowerBody] = Priority_SneakIdleLowerBody; + } else if(mIdleState != CharState_None) { idle = "idle"; diff --git a/apps/openmw/mwmechanics/character.hpp b/apps/openmw/mwmechanics/character.hpp index 4448467f7..fee7b959c 100644 --- a/apps/openmw/mwmechanics/character.hpp +++ b/apps/openmw/mwmechanics/character.hpp @@ -29,6 +29,7 @@ class CreatureStats; enum Priority { Priority_Default, Priority_WeaponLowerBody, + Priority_SneakIdleLowerBody, Priority_SwimIdle, Priority_Jump, Priority_Movement, diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index b14e629d0..078d136f1 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -680,7 +680,7 @@ namespace MWRender if(!(state->second.mBlendMask&(1<second.mPriority[blendMask] < state->second.mPriority[blendMask]) + if(active == mStates.end() || active->second.mPriority[(BoneGroup)blendMask] < state->second.mPriority[(BoneGroup)blendMask]) active = state; } diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index ef572c7c3..e64879a75 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -105,12 +105,12 @@ public: return true; } - int& operator[] (int n) + int& operator[] (BoneGroup n) { return mPriority[n]; } - const int& operator[] (int n) const + const int& operator[] (BoneGroup n) const { return mPriority[n]; }