CHostageImprov::IsFollowing: Fix reverse-engineering mistake

This commit is contained in:
s1lent 2017-11-12 02:08:56 +07:00
parent f69afc21a7
commit 49198dc022
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C

View File

@ -136,7 +136,16 @@ public:
// begin following "leader"
void Follow(CBasePlayer *leader) { m_followState.SetLeader(leader); m_behavior.SetState(&m_followState); }
bool IsFollowing(const CBaseEntity *leader = nullptr) const { return m_behavior.IsState(&m_followState); }
bool IsFollowing(const CBaseEntity *pLeader = nullptr) const
{
if (!m_behavior.IsState(&m_followState))
return false;
if (pLeader && pLeader != m_followState.GetLeader())
return false;
return true;
}
// Escape
void Escape() { m_behavior.SetState(&m_escapeState); }