diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index aa20e1414..abc6b82c4 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -179,6 +179,7 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim , mSkipAnim(false) , mSecondsOfRunning(0) , mSecondsOfSwimming(0) + , mUpdateWeapon(true) { if(!mAnimation) return; @@ -407,6 +408,13 @@ void CharacterController::update(float duration, Movement &movement) else weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); + if(mUpdateWeapon) + { + mWeaponType = weaptype; + forceStateUpdate(); + mUpdateWeapon = false; + } + if(weaptype != mWeaponType) { std::string weapgroup; diff --git a/apps/openmw/mwmechanics/character.hpp b/apps/openmw/mwmechanics/character.hpp index 7067176e0..cf5d6e823 100644 --- a/apps/openmw/mwmechanics/character.hpp +++ b/apps/openmw/mwmechanics/character.hpp @@ -104,6 +104,9 @@ class CharacterController WeaponType mWeaponType; bool mSkipAnim; + // Workaround for playing weapon draw animation and sound when going to new cell + bool mUpdateWeapon; + // counted for skill increase float mSecondsOfSwimming; float mSecondsOfRunning;