Skip to content

Commit

Permalink
fixed bots of same faction not fighting in arena until player trigger…
Browse files Browse the repository at this point in the history
…s it
  • Loading branch information
fuzzdeveloper committed Jul 11, 2024
1 parent 3316490 commit 72eb38a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/strategy/values/AttackersValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,21 @@ 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)
Expand Down

0 comments on commit 72eb38a

Please sign in to comment.