[6887] Position dead flying creatures on ground at creature loading.

Signed-off-by: Neo2003 <neo.2003@hotmail.fr>
This commit is contained in:
Neo2003 2008-12-07 13:03:24 +01:00
parent 211f987aa9
commit 09c27ec667
2 changed files with 9 additions and 1 deletions

View file

@ -1345,7 +1345,15 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
if(m_respawnTime > time(NULL)) // not ready to respawn
{
m_deathState = DEAD;
if(canFly())
{
float tz = GetMap()->GetHeight(data->posX,data->posY,data->posZ,false);
if(data->posZ - tz > 0.1)
Relocate(data->posX,data->posY,tz);
}
}
else if(m_respawnTime) // respawn time set but expired
{
m_respawnTime = 0;