1
This commit is contained in:
parent
7cc0c7e840
commit
63101cb762
@ -712,7 +712,7 @@ bool HeroAgent::InTargetShotRange()
|
|||||||
if (!current_target_agent->IsValid()) {
|
if (!current_target_agent->IsValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
float shot_range = GetShotRange();
|
float shot_range = current_target_agent->GetShotRange();
|
||||||
bool in_square = Collision::InSquare
|
bool in_square = Collision::InSquare
|
||||||
(GetPos(),
|
(GetPos(),
|
||||||
current_target_agent->GetPos(),
|
current_target_agent->GetPos(),
|
||||||
|
@ -86,3 +86,11 @@ Room* TargetAgent::GetRoom()
|
|||||||
{
|
{
|
||||||
return owner_->room;
|
return owner_->room;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float TargetAgent::GetShotRange()
|
||||||
|
{
|
||||||
|
if (target_.Get() && target_.Get()->GetCurrWeapon()) {
|
||||||
|
return target_.Get()->GetCurrWeapon()->meta->range();
|
||||||
|
}
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
@ -22,6 +22,7 @@ public:
|
|||||||
int GetHeroId();
|
int GetHeroId();
|
||||||
int GetLevel();
|
int GetLevel();
|
||||||
void Abandon();
|
void Abandon();
|
||||||
|
float GetShotRange();
|
||||||
|
|
||||||
void SetOwner(Creature* owner);
|
void SetOwner(Creature* owner);
|
||||||
virtual Room* GetRoom() override;
|
virtual Room* GetRoom() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user