Skip to content

Commit 99c26c6

Browse files
committed
Properly swap to marked / party leader targets in combat
1 parent 36bbaa5 commit 99c26c6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/game/PlayerBots/PartyBotAI.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,27 @@ void PartyBotAI::UpdateInCombatAI()
960960
return;
961961
}
962962

963+
Unit* pVictim = me->GetVictim();
964+
965+
// Swap to marked target or party leader's target
966+
if (GetRole() != ROLE_HEALER)
967+
{
968+
if (Player* pLeader = GetPartyLeader())
969+
{
970+
Unit* newVictim = SelectAttackTarget(pLeader);
971+
972+
if (newVictim && (newVictim != pVictim))
973+
{
974+
if (pVictim)
975+
me->AttackStop();
976+
else
977+
AttackStart(newVictim);
978+
979+
return;
980+
}
981+
}
982+
}
983+
963984
switch (me->GetClass())
964985
{
965986
case CLASS_PALADIN:

0 commit comments

Comments
 (0)