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

@@ -113,8 +113,8 @@ Unit* EnemyPlayerValue::Calculate()
continue;
if (Unit* pAttacker = pMember->getAttackerForHelper())
if (bot->IsWithinDist(pAttacker, maxAggroDistance * 2.0f) && bot->IsWithinLOSInMap(pAttacker) && pAttacker != pVictim
&& pAttacker->CanSeeOrDetect(bot) && pAttacker->IsPlayer())
if (pAttacker->IsPlayer() && bot->IsWithinDist(pAttacker, maxAggroDistance * 2.0f) && bot->IsWithinLOSInMap(pAttacker) && pAttacker != pVictim
&& pAttacker->CanSeeOrDetect(bot))
return pAttacker;
}
}