aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/CreatureAI.cpp')
-rw-r--r--src/game/CreatureAI.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 59df2e866f2..4668578c1be 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -71,7 +71,7 @@ void CreatureAI::OnCharmed(bool apply)
me->IsAIEnabled = false;
}
-void CreatureAI::DoZoneInCombat(Unit* pUnit)
+void CreatureAI::DoZoneInCombat(Creature* pUnit)
{
if (!pUnit)
pUnit = me;
@@ -84,6 +84,10 @@ void CreatureAI::DoZoneInCombat(Unit* pUnit)
return;
}
+ if(!pUnit->getVictim())
+ if(Unit *target = pUnit->SelectNearestTarget())
+ AttackStart(target);
+
if (!pUnit->CanHaveThreatList() || pUnit->getThreatManager().isThreatListEmpty())
{
sLog.outError("DoZoneInCombat called for creature that either cannot have threat list or has empty threat list (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0);