mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 09:29:09 +00:00
distance and reach related
This commit is contained in:
@@ -61,9 +61,11 @@ float DistanceValue::Calculate()
|
||||
}
|
||||
else if (qualifier == "current target")
|
||||
{
|
||||
Stance* stance = AI_VALUE(Stance*, "stance");
|
||||
WorldLocation loc = stance->GetLocation();
|
||||
return sServerFacade->GetDistance2d(botAI->GetBot(), loc.GetPositionX(), loc.GetPositionY());
|
||||
Unit* target = AI_VALUE(Unit*, qualifier);
|
||||
if (!target || !target->IsInWorld())
|
||||
return 0.0f;
|
||||
|
||||
return bot->GetDistance2d(target);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user