1
This commit is contained in:
parent
76fa3716b9
commit
5704658ab5
@ -1593,7 +1593,7 @@ behaviac::EBTStatus HeroAgent::SearchTeammate(int range)
|
||||
if (nearest_teammate) {
|
||||
float distance = nearest_teammate->GetPos().Distance2D2(owner_->GetPos());
|
||||
if (distance <= range) {
|
||||
current_target_agent->SetTarget(nearest_teammate);
|
||||
current_teammate_agent->SetTarget(nearest_teammate);
|
||||
return behaviac::BT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -115,3 +115,8 @@ bool TeammateAgent::HasBuffEffect(int effect_id)
|
||||
{
|
||||
return target_.Get() && target_.Get()->HasBuffEffect(effect_id);
|
||||
}
|
||||
|
||||
void TeammateAgent::SetTarget(Creature* target)
|
||||
{
|
||||
target_ = target->GetWeakPtrRef();
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
bool HasBuffEffect(int effect_id);
|
||||
|
||||
void SetOwner(Creature* owner);
|
||||
void SetTarget(Creature* target);
|
||||
virtual Room* GetRoom() override;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user