[Optimization] Valid target check order

This commit is contained in:
Yunfan Li
2024-06-28 20:16:29 +08:00
parent 3556a38dcd
commit 4661715fca

View File

@@ -174,8 +174,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
bool AttackersValue::IsValidTarget(Unit *attacker, Player *bot) bool AttackersValue::IsValidTarget(Unit *attacker, Player *bot)
{ {
return bot->IsWithinLOSInMap(attacker) && return IsPossibleTarget(attacker, bot) && bot->IsWithinLOSInMap(attacker);
IsPossibleTarget(attacker, bot);
// (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) || // (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) ||
// attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<ObjectGuid>("pull target")->Get()); // attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<ObjectGuid>("pull target")->Get());
} }