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.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 8633ee2e1f4..ea65d233a17 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -104,14 +104,22 @@ bool CreatureAI::UpdateVictim()
void CreatureAI::EnterEvadeMode()
{
+ if(me->IsInEvadeMode())
+ return;
+
me->RemoveAllAuras();
me->DeleteThreatList();
- me->CombatStop();
+ me->CombatStop(true);
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
if(me->isAlive())
- me->GetMotionMaster()->MoveTargetedHome();
+ {
+ if(Unit *owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE, MOTION_SLOT_IDLE);
+ else
+ me->GetMotionMaster()->MoveTargetedHome();
+ }
Reset();
}