Core/Creatures: Fix dead creatures spawn position on restart

Fix dead flying creatures ignoring being spawned below the floor in instances on server restart because of not taking into account vmap height.
Fix #16777
This commit is contained in:
jackpoz authored and Aokromes committed 2016-05-12 00:19:58 +02:00
1 parent 87db16e347
commit 5fa4faac38
1 file changed
+2 -2
@@ -1377,8 +1377,8 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
m_deathState = DEAD;
if (CanFly())
{
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, false);
if (data->posZ - tz > 0.1f)
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
if (data->posZ - tz > 0.1f && Trinity::IsValidMapCoord(tz))
Relocate(data->posX, data->posY, tz);
}
}