mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04: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)
|
if(movestate != sMovementListEnd)
|
||||||
{
|
{
|
||||||
movementAnimName = movestate->groupname;
|
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
|
std::string::size_type swimpos = movementAnimName.find("swim");
|
||||||
movementAnimName = weap->shortgroup + movementAnimName;
|
if (swimpos == std::string::npos)
|
||||||
else
|
{
|
||||||
movementAnimName += weap->shortgroup;
|
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))
|
if(!mAnimation->hasAnimation(movementAnimName))
|
||||||
{
|
{
|
||||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||||
movementAnimName = movestate->groupname;
|
movementAnimName = movestate->groupname;
|
||||||
|
|
||||||
// Since we apply movement only for lower body, do not reset idle animations.
|
if (swimpos == std::string::npos)
|
||||||
// For upper body there will be idle animation.
|
{
|
||||||
if (idle == CharState_None)
|
// Since we apply movement only for lower body, do not reset idle animations.
|
||||||
idle = CharState_Idle;
|
// For upper body there will be idle animation.
|
||||||
|
if (idle == CharState_None)
|
||||||
|
idle = CharState_Idle;
|
||||||
|
|
||||||
// For crossbow animations use 1h ones as fallback
|
// For crossbow animations use 1h ones as fallback
|
||||||
if (mWeaponType == WeapType_Crossbow)
|
if (mWeaponType == WeapType_Crossbow)
|
||||||
movementAnimName += "1h";
|
movementAnimName += "1h";
|
||||||
|
}
|
||||||
|
else if (idle == CharState_None)
|
||||||
|
{
|
||||||
|
idle = CharState_IdleSwim;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user