Skip to content

Commit 05dd544

Browse files
committed
Port fix from CoC - reuse knife animations for torso unarmed/binocular anims
1 parent c2feb28 commit 05dd544

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/xrGame/ActorAnimation.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,11 @@ void CActor::g_SetAnimation(u32 mstate_rl, bool force)
326326
{
327327
if (m_current_legs || m_current_torso)
328328
{
329-
// SActorState* ST = 0;
330-
// if (mstate_rl & mcCrouch)
331-
// ST = &m_anims->m_crouch;
332-
// else
333-
// ST = &m_anims->m_normal;
329+
SActorState* ST = 0;
330+
if (mstate_rl & mcCrouch)
331+
ST = &m_anims->m_crouch;
332+
else
333+
ST = &m_anims->m_normal;
334334
mstate_real = 0;
335335
m_current_legs.invalidate();
336336
m_current_torso.invalidate();
@@ -514,6 +514,9 @@ void CActor::g_SetAnimation(u32 mstate_rl, bool force)
514514
default: M_torso = TW->moving[moving_idx]; break;
515515
}
516516
}
517+
518+
if (!M_torso)
519+
M_torso = ST->m_torso[4].moving[moving_idx]; //Alundaio: Fix torso animations for binoc
517520
}
518521
else if (M)
519522
{
@@ -560,10 +563,12 @@ void CActor::g_SetAnimation(u32 mstate_rl, bool force)
560563
}
561564
}
562565
}
566+
else if (!m_bAnimTorsoPlayed)
567+
M_torso = ST->m_torso[4].moving[moving_idx]; //Alundaio: Fix torso animations for no weapon
563568
}
564569

565570
// XXX: check why 'mid' was unused
566-
//MotionID mid = smart_cast<IKinematicsAnimated*>(Visual())->ID_Cycle("norm_idle_0");
571+
MotionID mid = smart_cast<IKinematicsAnimated*>(Visual())->ID_Cycle("norm_idle_0");
567572

568573
if (!M_legs)
569574
{
@@ -627,14 +632,6 @@ void CActor::g_SetAnimation(u32 mstate_rl, bool force)
627632

628633
m_current_legs = M_legs;
629634

630-
if (m_firstPersonBody) // Yohji: hacky way to force bones to render correctly on load
631-
{
632-
if (m_current_legs_blend)
633-
PlayMotionByParts(m_firstPersonBody->dcast_PKinematicsAnimated(), m_current_legs_blend->motionID, TRUE, legs_play_callback, this);
634-
else
635-
PlayMotionByParts(m_firstPersonBody->dcast_PKinematicsAnimated(), M_legs, TRUE, legs_play_callback, this);
636-
}
637-
638635
CStepManager::on_animation_start(M_legs, m_current_legs_blend);
639636
}
640637

0 commit comments

Comments
 (0)