mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 02:40:28 +00:00
greatly improve performance
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ bool PartyMemberToHeal::Check(Unit* player)
|
||||
{
|
||||
// return player && player != bot && player->GetMapId() == bot->GetMapId() && player->IsInWorld() &&
|
||||
// sServerFacade->GetDistance2d(bot, player) < (player->IsPlayer() && botAI->IsTank((Player*)player) ? 50.0f : 40.0f);
|
||||
return player && player->GetMapId() == bot->GetMapId() &&
|
||||
return player->GetMapId() == bot->GetMapId() &&
|
||||
bot->GetDistance2d(player) < sPlayerbotAIConfig->healDistance * 2 &&
|
||||
bot->IsWithinLOS(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user