diff --git a/server/gameserver/hero_agent.cc b/server/gameserver/hero_agent.cc index 24a1cec5..27d20e04 100644 --- a/server/gameserver/hero_agent.cc +++ b/server/gameserver/hero_agent.cc @@ -17,6 +17,7 @@ #include "team.h" #include "master_agent.h" #include "team_agent.h" +#include "teammate_agent.h" #include "skill.h" #include "loot.h" #include "car.h" @@ -35,6 +36,7 @@ HeroAgent::HeroAgent():BaseAgent() current_target_agent = behaviac::Agent::Create(); master_agent = behaviac::Agent::Create(); team_agent = behaviac::Agent::Create(); + current_teammate_agent = behaviac::Agent::Create(); INIT_LIST_HEAD(&coroutines_list_); } @@ -52,6 +54,10 @@ HeroAgent::~HeroAgent() f8::BtMgr::Instance()->BtDestory(team_agent); team_agent = nullptr; } + { + f8::BtMgr::Instance()->BtDestory(current_teammate_agent); + current_teammate_agent = nullptr; + } } void HeroAgent::SetOwner(Creature* owner)