aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rwxr-xr-xsrc/server/game/AI/CreatureAI.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 17cef3ec1a1..e5868117da8 100755
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -153,13 +153,20 @@ void CreatureAI::EnterEvadeMode()
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
}
else
+ {
+ // Required to prevent attacking creatures that are evading and cause them to reenter combat
+ // Does not apply to MoveFollow
+ me->AddUnitState(UNIT_STATE_EVADE);
me->GetMotionMaster()->MoveTargetedHome();
+ }
}
Reset();
if (me->IsVehicle()) // use the same sequence of addtoworld, aireset may remove all summons!
me->GetVehicleKit()->Reset(true);
+
+ me->SetLastDamagedTime(0);
}
/*void CreatureAI::AttackedBy(Unit* attacker)