Core/Scripts: Fixed ENSURE_AI assertion failures when used in Reset()/InitializeAI() hooks with hotswap

Updates #20727

(cherry picked from commit 2fd9dc2edb0355d15f5afd21cc6aa61d172d19cc)
This commit is contained in:
Shauren
2018-02-05 23:41:39 +01:00
parent 4e373426aa
commit 8ed52e9dc3
3 changed files with 17 additions and 3 deletions
+2 -1
View File
@@ -453,7 +453,7 @@ class CreatureGameObjectAreaTriggerScriptRegistrySwapHooks
if (creature->IsAlive())
creature->ClearUnitState(UNIT_STATE_EVADE);
bool const created = creature->AIM_Initialize();
bool const created = creature->AIM_Create();
ASSERT(created,
"Creating the AI should never fail here!");
(void)created;
@@ -464,6 +464,7 @@ class CreatureGameObjectAreaTriggerScriptRegistrySwapHooks
if (!creature->IsAlive())
return;
creature->AI_InitializeAndEnable();
creature->AI()->EnterEvadeMode();
// Cast a dummy visual spell asynchronously here to signal