greatly improve performance

This commit is contained in:
Yunfan Li
2023-07-28 23:27:28 +08:00
parent 74293912ec
commit 7bd7c46088
6 changed files with 19 additions and 17 deletions

View File

@@ -13,7 +13,7 @@ GuidVector NearestUnitsValue::Calculate()
GuidVector results;
for (Unit* unit : targets)
{
if ((ignoreLos || bot->IsWithinLOSInMap(unit)) && AcceptUnit(unit))
if (AcceptUnit(unit) && (ignoreLos || bot->IsWithinLOSInMap(unit)))
results.push_back(unit->GetGUID());
}