Reduce string overhead and totem check overhead

This commit is contained in:
Yunfan Li
2024-04-11 14:37:15 +08:00
parent b474dc44bb
commit 9d69e9263b
6 changed files with 29 additions and 6 deletions

View File

@@ -50,4 +50,16 @@ void NearestTriggersValue::FindUnits(std::list<Unit*>& targets)
bool NearestTriggersValue::AcceptUnit(Unit* unit)
{
return !unit->IsPlayer();
}
void NearestTotemsValue::FindUnits(std::list<Unit*>& targets)
{
Acore::AnyUnitInObjectRangeCheck u_check(bot, range);
Acore::UnitListSearcher<Acore::AnyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
Cell::VisitAllObjects(bot, searcher, range);
}
bool NearestTotemsValue::AcceptUnit(Unit* unit)
{
return unit->IsTotem();
}