aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-01-13 18:38:54 +0100
committerShauren <shauren.trinity@gmail.com>2016-03-29 19:36:05 +0200
commit009cabb4b9d60a02ed2f219127c0df293ea96580 (patch)
tree8cf5a56aeee002e94329c339a1a934dae451b868 /src/server/game/AI/CreatureAI.cpp
parent21371075ff4efc82a8567dfd604137577f4400e7 (diff)
Merge branch '3.3.5-spellfacing' into 3.3.5-base (PR #15641)
(cherry picked from commit 233297c5c8619af96e2aab4fa5ef6d205b5dc18a)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 8ef8940e89f..c254a9124c1 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -204,7 +204,8 @@ void CreatureAI::SetGazeOn(Unit* target)
{
if (me->IsValidAttackTarget(target))
{
- AttackStart(target);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(target);
me->SetReactState(REACT_PASSIVE);
}
}
@@ -223,7 +224,8 @@ bool CreatureAI::UpdateVictimWithGaze()
}
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}
@@ -236,7 +238,8 @@ bool CreatureAI::UpdateVictim()
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- AttackStart(victim);
+ if (!me->IsFocusing(nullptr, true))
+ AttackStart(victim);
return me->GetVictim() != nullptr;
}