NSMonster: add support for sequence
key, used by some sitting NPCs.
This commit is contained in:
parent
bd74c588da
commit
e9f9ae5829
2 changed files with 13 additions and 0 deletions
|
@ -596,6 +596,7 @@ private:
|
|||
|
||||
float m_flLeapDamage;
|
||||
bool m_bLeapAttacked;
|
||||
float m_flForceSequence;
|
||||
|
||||
nonvirtual void _LerpTurnToEnemy(void);
|
||||
nonvirtual void _LerpTurnToPos(vector);
|
||||
|
|
|
@ -1476,6 +1476,15 @@ NSMonster::Physics(void)
|
|||
if (!IsAlive)
|
||||
return;
|
||||
|
||||
if (m_flForceSequence) {
|
||||
if (m_iSequenceState != SEQUENCESTATE_IDLE) {
|
||||
SetFrame(m_flForceSequence);
|
||||
}
|
||||
m_flAnimTime = time + 999.0f;
|
||||
frame = m_flForceSequence;
|
||||
m_iSequenceState = SEQUENCESTATE_IDLE;
|
||||
}
|
||||
|
||||
/* unset the leap attack */
|
||||
if (m_bLeapAttacked == true && HasFlags(FL_ONGROUND) == true) {
|
||||
m_bLeapAttacked = false;
|
||||
|
@ -2037,6 +2046,9 @@ NSMonster::SpawnKey(string strKey, string strValue)
|
|||
case "frame":
|
||||
_m_flFrame = ReadFloat(strValue);
|
||||
break;
|
||||
case "sequence":
|
||||
m_flForceSequence = ReadFloat(strValue);
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue