Core/SmartAI: Prevent recursive EnterEvadeMode call

Ref #8679
This commit is contained in:
Machiavelli
2013-02-19 16:35:26 +01:00
parent 12e5541636
commit 6b63a98ab0
+5 -1
View File
@@ -422,6 +422,9 @@ void SmartAI::MovepointReached(uint32 id)
void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
{
if ((MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT) || MovementType == FOLLOW_MOTION_TYPE)
me->ClearUnitState(UNIT_STATE_EVADE);
GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, NULL, MovementType, Data);
if (MovementType != POINT_MOTION_TYPE || !HasEscortState(SMART_ESCORT_ESCORTING))
return;
@@ -443,11 +446,12 @@ void SmartAI::RemoveAuras()
void SmartAI::EnterEvadeMode()
{
if (!me->isAlive())
if (!me->isAlive() || me->IsInEvadeMode())
return;
RemoveAuras();
me->AddUnitState(UNIT_STATE_EVADE);
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon();