This commit is contained in:
aozhiwei 2023-10-14 11:50:58 +08:00
parent dda5d1a4a7
commit 15488a4309

View File

@ -10,6 +10,7 @@
#include "target_agent.h"
#include "weapon.h"
#include "mapinstance.h"
#include "collision.h"
#include "mt/Hero.h"
#include "mt/Equip.h"
@ -247,17 +248,22 @@ bool HeroAgent::HasBuffEffect(int effect_id)
bool HeroAgent::IsNearGas(float range)
{
float x_distance = std::fabs(owner_->GetPos().ToGlmVec3().x -
owner_->room->GetGasData().pos_old.x);
float z_distance = std::fabs(owner_->GetPos().ToGlmVec3().z -
owner_->room->GetGasData().pos_old.y);
return false;
return Collision::IsNearInRange
(owner_->GetPos().ToGlmVec3(),
owner_->GetPos().ToGlmVec3(),
range);
}
bool HeroAgent::MasterInRange(float range)
{
abort();
if (!owner_->IsHero() ||
!owner_->AsHero()->master.Get()) {
return false;
}
return Collision::IsNearInRange
(owner_->AsHero()->master.Get()->GetPos().ToGlmVec3(),
owner_->GetPos().ToGlmVec3(),
range);
}
behaviac::EBTStatus HeroAgent::SearchEnemy(float range)