From 0bec6e5fbefe6017c757b36e07192c8f9a7c8b19 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 26 Dec 2015 18:45:09 +0100 Subject: [PATCH] Fix 'failed to find animation' warnings when a spell was equipped before the werewolf transformation --- apps/openmw/mwmechanics/character.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index ba6a8fe4b..db1b82ba6 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -520,6 +520,8 @@ void getWeaponGroup(WeaponType weaptype, std::string &group) const WeaponInfo *info = std::find_if(sWeaponTypeList, sWeaponTypeListEnd, FindWeaponType(weaptype)); if(info != sWeaponTypeListEnd) group = info->longgroup; + else + group.clear(); } @@ -1092,11 +1094,14 @@ bool CharacterController::updateWeaponState() std::string weapgroup; if(weaptype == WeapType_None) { - getWeaponGroup(mWeaponType, weapgroup); - mAnimation->play(weapgroup, priorityWeapon, - MWRender::Animation::BlendMask_All, true, - 1.0f, "unequip start", "unequip stop", 0.0f, 0); - mUpperBodyState = UpperCharState_UnEquipingWeap; + if ((!isWerewolf || mWeaponType != WeapType_Spell)) + { + getWeaponGroup(mWeaponType, weapgroup); + mAnimation->play(weapgroup, priorityWeapon, + MWRender::Animation::BlendMask_All, true, + 1.0f, "unequip start", "unequip stop", 0.0f, 0); + mUpperBodyState = UpperCharState_UnEquipingWeap; + } } else {