Core/SAI: Remove completed timed action lists even while evading

Port From (https://github.com/TrinityCore/TrinityCore/commit/1f2c48f8bb2396995c1e37e914ef2f3fa6bca490)
This commit is contained in:
hondacrx
2022-03-11 09:29:22 -05:00
parent 51e2740251
commit cb52217cad
@@ -3906,7 +3906,24 @@ namespace Game.AI
return;
if (_me != null && _me.IsInEvadeMode())
{
// Check if the timed action list finished and clear it if so.
// This is required by SMART_ACTION_CALL_TIMED_ACTIONLIST failing if mTimedActionList is not empty.
if (!_timedActionList.Empty())
{
bool needCleanup1 = true;
foreach (SmartScriptHolder scriptholder in _timedActionList)
{
if (scriptholder.EnableTimed)
needCleanup1 = false;
}
if (needCleanup1)
_timedActionList.Clear();
}
return;
}
InstallEvents();//before UpdateTimers