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

(cherry picked from commit 912514c198bd0f59bd22c4a189692aff5244f697)
This commit is contained in:
jackpoz
2016-04-09 17:10:24 +02:00
committed by Shauren
parent 94c33ea43c
commit 307a93839b
@@ -1382,8 +1382,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);
}
}