mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Scripts: Fixed ENSURE_AI assertion failures when used in Reset()/InitializeAI() hooks with hotswap
Updates #20727
This commit is contained in:
@@ -421,7 +421,7 @@ class CreatureGameObjectScriptRegistrySwapHooks
|
||||
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;
|
||||
@@ -432,6 +432,7 @@ class CreatureGameObjectScriptRegistrySwapHooks
|
||||
if (!creature->IsAlive())
|
||||
return;
|
||||
|
||||
creature->AI_InitializeAndEnable();
|
||||
creature->AI()->EnterEvadeMode();
|
||||
|
||||
// Cast a dummy visual spell asynchronously here to signal
|
||||
|
||||
Reference in New Issue
Block a user