mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 09:32:45 +00:00
Merge pull request #1953 from Capostrophic/animation
Fix first person swimming animations
This commit is contained in:
commit
585313a71f
@ -432,26 +432,37 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||
if(movestate != sMovementListEnd)
|
||||
{
|
||||
movementAnimName = movestate->groupname;
|
||||
if(weap != sWeaponTypeListEnd && movementAnimName.find("swim") == std::string::npos)
|
||||
if(weap != sWeaponTypeListEnd)
|
||||
{
|
||||
if (mWeaponType == WeapType_Spell && (movement == CharState_TurnLeft || movement == CharState_TurnRight)) // Spellcasting stance turning is a special case
|
||||
movementAnimName = weap->shortgroup + movementAnimName;
|
||||
else
|
||||
movementAnimName += weap->shortgroup;
|
||||
std::string::size_type swimpos = movementAnimName.find("swim");
|
||||
if (swimpos == std::string::npos)
|
||||
{
|
||||
if (mWeaponType == WeapType_Spell && (movement == CharState_TurnLeft || movement == CharState_TurnRight)) // Spellcasting stance turning is a special case
|
||||
movementAnimName = weap->shortgroup + movementAnimName;
|
||||
else
|
||||
movementAnimName += weap->shortgroup;
|
||||
}
|
||||
|
||||
if(!mAnimation->hasAnimation(movementAnimName))
|
||||
{
|
||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||
movementAnimName = movestate->groupname;
|
||||
|
||||
// Since we apply movement only for lower body, do not reset idle animations.
|
||||
// For upper body there will be idle animation.
|
||||
if (idle == CharState_None)
|
||||
idle = CharState_Idle;
|
||||
if (swimpos == std::string::npos)
|
||||
{
|
||||
// Since we apply movement only for lower body, do not reset idle animations.
|
||||
// For upper body there will be idle animation.
|
||||
if (idle == CharState_None)
|
||||
idle = CharState_Idle;
|
||||
|
||||
// For crossbow animations use 1h ones as fallback
|
||||
if (mWeaponType == WeapType_Crossbow)
|
||||
movementAnimName += "1h";
|
||||
// For crossbow animations use 1h ones as fallback
|
||||
if (mWeaponType == WeapType_Crossbow)
|
||||
movementAnimName += "1h";
|
||||
}
|
||||
else if (idle == CharState_None)
|
||||
{
|
||||
idle = CharState_IdleSwim;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user