fix(Core/TotemAI): Totems should not attack neutral unless owner is in combat (#5434)
This commit is contained in:
parent
46c9aa6f3a
commit
752595dccf
2 changed files with 7 additions and 1 deletions
|
|
@ -76,6 +76,12 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
|||
me->VisitNearbyObject(max_range, checker);
|
||||
}
|
||||
|
||||
|
||||
if (!victim && me->GetCharmerOrOwnerOrSelf()->IsInCombat())
|
||||
{
|
||||
victim = me->GetCharmerOrOwnerOrSelf()->GetVictim();
|
||||
}
|
||||
|
||||
// If have target
|
||||
if (victim)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ namespace acore
|
|||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isTargetableForAttack(true, i_funit) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
!i_funit->IsFriendlyTo(u) && i_funit->CanSeeOrDetect(u))
|
||||
(i_funit->IsInCombatWith(u) || i_funit->IsHostileTo(u)) && i_obj->CanSeeOrDetect(u))
|
||||
{
|
||||
i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue