fixed bots of same faction not fighting in arena until player triggers it

This commit is contained in:
Fuzz
2024-07-11 13:06:17 +10:00
parent 3316490f5d
commit 72eb38af88

View File

@@ -48,7 +48,20 @@ GuidVector AttackersValue::Calculate()
if (bot->duel && bot->duel->Opponent)
result.push_back(bot->duel->Opponent->GetGUID());
return result;
// workaround for bots of same faction not fighting in arena
if (bot->InArena())
{
GuidVector possibleTargets = AI_VALUE(GuidVector, "possible targets");
for (ObjectGuid const guid : possibleTargets)
{
Unit* unit = botAI->GetUnit(guid);
if (unit && unit->IsPlayer() && IsValidTarget(unit, bot)) {
result.push_back(unit->GetGUID());
}
}
}
return result;
}
void AttackersValue::AddAttackersOf(Group* group, std::unordered_set<Unit*>& targets)