From 2d4dac07113c6620b6fa8f6d8d0648cbb18ccdcd Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 20 Aug 2009 16:12:23 -0500 Subject: *Try to fix the bug of mobs' chain aggro. --HG-- branch : trunk --- src/game/CreatureAI.cpp | 2 +- src/game/CreatureEventAI.cpp | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index 165bb2411ec..e12baa137d5 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -112,7 +112,7 @@ void CreatureAI::MoveInLineOfSight(Unit *who) else if(who->getVictim() && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) && me->canStartAttack(who->getVictim(), true)) - AttackStart(who->getVictim()); + me->GetMotionMaster()->MoveChase(who->getVictim()); } void CreatureAI::SelectNearestTarget(Unit *who) diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index 5c425217844..78a8689a6de 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -998,12 +998,7 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who) } } - if(me->canStartAttack(who, false)) - AttackStart(who); - else if(who->getVictim() && me->IsFriendlyTo(who) - && me->IsWithinDistInMap(who, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) - && me->canStartAttack(who->getVictim(), true)) - AttackStart(who->getVictim()); + CreatureAI::MoveInLineOfSight(who); } void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) -- cgit v1.2.3