Added keyvalue to ai_goal_follow to enable normal memory discard duration

This commit is contained in:
Blixibon 2021-09-20 22:07:16 -05:00
parent 08dcf3ffff
commit 4d4296dac2
2 changed files with 9 additions and 1 deletions

View File

@ -408,10 +408,11 @@ bool CAI_FollowBehavior::SetFollowGoal( CAI_FollowGoal *pGoal, bool fFinishCurSc
SetFollowTarget( pGoal->GetGoalEntity() ); SetFollowTarget( pGoal->GetGoalEntity() );
#ifdef MAPBASE #ifdef MAPBASE
Assert( pGoal->m_iFormation < AIF_NUM_FORMATIONS ); Assert( pGoal->m_iFormation < AIF_NUM_FORMATIONS );
SetParameters( AI_FollowParams_t( (AI_Formations_t)pGoal->m_iFormation, pGoal->m_bNormalMemoryDiscard ) );
#else #else
Assert( pGoal->m_iFormation == AIF_SIMPLE || pGoal->m_iFormation == AIF_WIDE || pGoal->m_iFormation == AIF_MEDIUM || pGoal->m_iFormation == AIF_SIDEKICK || pGoal->m_iFormation == AIF_VORTIGAUNT ); Assert( pGoal->m_iFormation == AIF_SIMPLE || pGoal->m_iFormation == AIF_WIDE || pGoal->m_iFormation == AIF_MEDIUM || pGoal->m_iFormation == AIF_SIDEKICK || pGoal->m_iFormation == AIF_VORTIGAUNT );
#endif
SetParameters( AI_FollowParams_t( (AI_Formations_t)pGoal->m_iFormation ) ); SetParameters( AI_FollowParams_t( (AI_Formations_t)pGoal->m_iFormation ) );
#endif
m_hFollowGoalEnt = pGoal; m_hFollowGoalEnt = pGoal;
m_flTimeUpdatedFollowPosition = 0; m_flTimeUpdatedFollowPosition = 0;
return true; return true;
@ -2138,6 +2139,9 @@ bool CAI_FollowBehavior::ShouldAlwaysThink()
BEGIN_DATADESC( CAI_FollowGoal ) BEGIN_DATADESC( CAI_FollowGoal )
DEFINE_KEYFIELD( m_iFormation, FIELD_INTEGER, "Formation" ), DEFINE_KEYFIELD( m_iFormation, FIELD_INTEGER, "Formation" ),
#ifdef MAPBASE
DEFINE_KEYFIELD( m_bNormalMemoryDiscard, FIELD_BOOLEAN, "NormalMemoryDiscard" ),
#endif
#ifdef HL2_EPISODIC #ifdef HL2_EPISODIC
DEFINE_INPUTFUNC( FIELD_VOID, "OutsideTransition", InputOutsideTransition ), DEFINE_INPUTFUNC( FIELD_VOID, "OutsideTransition", InputOutsideTransition ),

View File

@ -71,6 +71,10 @@ public:
int m_iFormation; int m_iFormation;
#ifdef MAPBASE
bool m_bNormalMemoryDiscard = false;
#endif
DECLARE_DATADESC(); DECLARE_DATADESC();
}; };