Core/SmartAI: delay SMART_ACTION_FLEE_FOR_ASSIST if creature is rooted/stunned.

Prevents creatures from teleporting around when fleeing while stunned/rooted.
This commit is contained in:
Snapper
2016-06-04 21:17:15 +02:00
parent 24ac2bb9be
commit aaf10dccb0

View File

@@ -3356,6 +3356,16 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
}
}
// Delay flee for assist event if stunned or rooted
if (e.GetActionType() == SMART_ACTION_FLEE_FOR_ASSIST)
{
if (me && me->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
{
e.timer = 1;
return;
}
}
e.active = true;//activate events with cooldown
switch (e.GetEventType())//process ONLY timed events
{