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
2016-03-15 22:02:14 +01:00
committed by Aokromes
parent 87db16e347
commit 5fa4faac38

View File

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