diff --git a/regamedll/dlls/hostage/hostage_improv.h b/regamedll/dlls/hostage/hostage_improv.h index 791d3ca0..93bd27c1 100644 --- a/regamedll/dlls/hostage/hostage_improv.h +++ b/regamedll/dlls/hostage/hostage_improv.h @@ -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); }