From bf595a0fe3bfe73529741423045811cf29fbd6bc Mon Sep 17 00:00:00 2001 From: spp Date: Sun, 6 Dec 2009 16:41:05 +0100 Subject: Fix a crash in creature respawn, closes #566 --HG-- branch : trunk --- src/game/Creature.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 4493142fb89..03068041f23 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -238,7 +238,7 @@ void Creature::RemoveCorpse() ObjectAccessor::UpdateObjectVisibility(this); loot.clear(); uint32 respawnDelay = m_respawnDelay; - if (AI()) + if (IsAIEnabled) AI()->CorpseRemoved(respawnDelay); m_respawnTime = time(NULL) + m_respawnDelay; @@ -1894,7 +1894,8 @@ void Creature::Respawn(bool force) } //Call AI respawn virtual function - AI()->JustRespawned(); + if (IsAIEnabled) + AI()->JustRespawned(); uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId()); if (poolid) -- cgit v1.2.3