distance and reach related

This commit is contained in:
Yunfan Li
2023-05-30 17:10:22 +08:00
parent 0fa640959f
commit ffb0b260d3
3 changed files with 9 additions and 28 deletions

View File

@@ -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
{