1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-09 22:11:33 +00:00

Fix swim spellcasting stance turning fallback

This commit is contained in:
Alexei Kotov 2022-06-13 23:58:36 +03:00
parent 5dfce6205a
commit 4ce08664e9

View file

@ -573,6 +573,7 @@ void CharacterController::refreshMovementAnims(CharacterState movement, bool for
return; return;
} }
mMovementState = movement;
std::string::size_type swimpos = movementAnimName.find("swim"); std::string::size_type swimpos = movementAnimName.find("swim");
if (!mAnimation->hasAnimation(movementAnimName)) if (!mAnimation->hasAnimation(movementAnimName))
{ {
@ -590,7 +591,7 @@ void CharacterController::refreshMovementAnims(CharacterState movement, bool for
{ {
std::string weapMovementAnimName; std::string weapMovementAnimName;
// Spellcasting stance turning is a special case // Spellcasting stance turning is a special case
if (mWeaponType == ESM::Weapon::Spell && (movement == CharState_TurnLeft || movement == CharState_TurnRight)) if (mWeaponType == ESM::Weapon::Spell && isTurning())
weapMovementAnimName = weapShortGroup + movementAnimName; weapMovementAnimName = weapShortGroup + movementAnimName;
else else
weapMovementAnimName = movementAnimName + weapShortGroup; weapMovementAnimName = movementAnimName + weapShortGroup;
@ -616,8 +617,6 @@ void CharacterController::refreshMovementAnims(CharacterState movement, bool for
} }
} }
mMovementState = movement;
// If we're playing the same animation, start it from the point it ended // If we're playing the same animation, start it from the point it ended
float startpoint = 0.f; float startpoint = 0.f;
if (!mCurrentMovement.empty() && movementAnimName == mCurrentMovement) if (!mCurrentMovement.empty() && movementAnimName == mCurrentMovement)