diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/CreatureAI.cpp | 6 | ||||
| -rw-r--r-- | src/game/CreatureAI.h | 4 |
2 files changed, 7 insertions, 3 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); diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index d83a9eb2cd8..cae7026f6c7 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -94,7 +94,7 @@ class EventMap : private std::map<uint32, uint32> m_phase = (1 << (phase + 24)); } - void ScheduleEvent(uint32 time, uint32 eventId, uint32 gcd = 0, uint32 phase = 0) + void ScheduleEvent(uint32 eventId, uint32 time, uint32 gcd = 0, uint32 phase = 0) { time += m_time; if(gcd && gcd < 9) @@ -245,7 +245,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI // Called at reaching home after evade virtual void JustReachedHome() {} - void DoZoneInCombat(Unit* pUnit = NULL); + void DoZoneInCombat(Creature* pUnit = NULL); // Called at text emote receive from player virtual void ReceiveEmote(Player* pPlayer, uint32 text_emote) {} |
