mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user