Fix a crash in creature respawn, closes #566

--HG--
branch : trunk
This commit is contained in:
spp
2009-12-06 16:41:05 +01:00
parent 314031016b
commit bf595a0fe3

View File

@@ -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)