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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user