Core/Scripting: Kill pending unit events when swapping AI's

(cherry picked from commit 851c73b3e47b4b64639f4d825b00d069330059e3)
This commit is contained in:
Naios
2016-05-01 17:50:34 +02:00
parent c28e6a8c16
commit 8bf3d181b6
+2
View File
@@ -368,6 +368,8 @@ class CreatureGameObjectScriptRegistrySwapHooks
// Hook which is called before a creature is swapped
static void UnloadStage1(Creature* creature)
{
creature->m_Events.KillAllEvents(true);
if (creature->IsCharmed())
creature->RemoveCharmedBy(nullptr);