mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Set activity before SetYawSpeed so it has the right activity
This commit is contained in:
parent
470a71540b
commit
467899b99a
@ -1208,13 +1208,19 @@ void CBaseMonster::SetActivity( Activity NewActivity )
|
|||||||
|
|
||||||
iSequence = LookupActivity( NewActivity );
|
iSequence = LookupActivity( NewActivity );
|
||||||
|
|
||||||
|
Activity OldActivity = m_Activity;
|
||||||
|
m_Activity = NewActivity; // Go ahead and set this so it doesn't keep trying when the anim is not present
|
||||||
|
|
||||||
|
// In case someone calls this with something other than the ideal activity
|
||||||
|
m_IdealActivity = m_Activity;
|
||||||
|
|
||||||
// Set to the desired anim, or default anim if the desired is not present
|
// Set to the desired anim, or default anim if the desired is not present
|
||||||
if( iSequence > ACTIVITY_NOT_AVAILABLE )
|
if( iSequence > ACTIVITY_NOT_AVAILABLE )
|
||||||
{
|
{
|
||||||
if( pev->sequence != iSequence || !m_fSequenceLoops )
|
if( pev->sequence != iSequence || !m_fSequenceLoops )
|
||||||
{
|
{
|
||||||
// don't reset frame between walk and run
|
// don't reset frame between walk and run
|
||||||
if( !( m_Activity == ACT_WALK || m_Activity == ACT_RUN ) || !( NewActivity == ACT_WALK || NewActivity == ACT_RUN ) )
|
if( !( OldActivity == ACT_WALK || OldActivity == ACT_RUN ) || !( NewActivity == ACT_WALK || NewActivity == ACT_RUN ) )
|
||||||
pev->frame = 0;
|
pev->frame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1228,11 +1234,6 @@ void CBaseMonster::SetActivity( Activity NewActivity )
|
|||||||
ALERT( at_aiconsole, "%s has no sequence for act:%d\n", STRING( pev->classname ), NewActivity );
|
ALERT( at_aiconsole, "%s has no sequence for act:%d\n", STRING( pev->classname ), NewActivity );
|
||||||
pev->sequence = 0; // Set to the reset anim (if it's there)
|
pev->sequence = 0; // Set to the reset anim (if it's there)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Activity = NewActivity; // Go ahead and set this so it doesn't keep trying when the anim is not present
|
|
||||||
|
|
||||||
// In case someone calls this with something other than the ideal activity
|
|
||||||
m_IdealActivity = m_Activity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user