aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 81077ab5565..bf7fe72bd5a 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -68,6 +68,10 @@ void UnitAI::DoMeleeAttackIfReady()
if (!me->IsWithinMeleeRange(victim))
return;
+ // Check that the victim is in front of the unit
+ if (!me->HasInArc(2 * float(M_PI) / 3, victim))
+ return;
+
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me->isAttackReady())
{