Core/Scripting: Don't force event cancellation when swapping creatures.

* EventProcessor::KillAllEvents(force = false) should only be used
  by the EventProcessor.
This commit is contained in:
Naios
2016-07-02 18:38:24 +02:00
parent fad58ad099
commit d68316fcd2

View File

@@ -368,7 +368,9 @@ class CreatureGameObjectScriptRegistrySwapHooks
// Hook which is called before a creature is swapped
static void UnloadStage1(Creature* creature)
{
creature->m_Events.KillAllEvents(true);
// Remove deletable events only,
// otherwise it causes crashes with non-deletable spell events.
creature->m_Events.KillAllEvents(false);
if (creature->IsCharmed())
creature->RemoveCharmedBy(nullptr);