From ed4cfd37f4a00147ca82199855a2fa2d3c841995 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Thu, 5 Aug 2021 15:15:12 +0200 Subject: [PATCH] fix(Core/Totems): Searing Totem will properly attack neutral targets. (#7157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed #6310 Co-authored-by: Stefano Borzì --- src/server/game/AI/CoreAI/TotemAI.cpp | 2 +- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index cbb1e99bb..f456ae2d3 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -78,7 +78,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/) if (!victim && me->GetCharmerOrOwnerOrSelf()->IsInCombat()) { - victim = me->GetCharmerOrOwnerOrSelf()->GetVictim(); + victim = me->GetCharmerOrOwnerOrSelf()->getAttackerForHelper(); } // If have target diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 0683477ae..e0c66497f 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -933,7 +933,7 @@ namespace Acore bool operator()(Unit* u) { if (u->isTargetableForAttack(true, i_funit) && i_obj->IsWithinDistInMap(u, i_range) && - (i_funit->IsInCombatWith(u) || i_funit->IsHostileTo(u)) && i_obj->CanSeeOrDetect(u)) + (i_funit->IsInCombatWith(u) || u->IsHostileTo(i_funit)) && i_obj->CanSeeOrDetect(u)) { i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check return true;