mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Scripts: Fix Hotswap not reinitializing AIs after destroying them and then crashing due to AI being nullptr (#27744)
This commit is contained in:
@@ -554,7 +554,7 @@ class CreatureGameObjectAreaTriggerScriptRegistrySwapHooks
|
||||
// When the script Id of the script isn't removed in this
|
||||
// context change, do nothing.
|
||||
uint32 aiId = object.second->AI() ? object.second->AI()->GetId() : 0;
|
||||
if (idsToRemove.find(aiId) != idsToRemove.end())
|
||||
if (idsToRemove.find(aiId) != idsToRemove.end() || (aiId == 0 && object.second->GetScriptId()))
|
||||
visitor(object.second);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user