mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Core/Creature): Reduce z offset for automated spawn correction (#18153)
- this is necessary to correctly spawn creatures within small defines - 0.42f is as good as 1.0f to detect and correct reasonable z errors in DB spawn data
This commit is contained in:
@@ -1669,8 +1669,8 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
|
||||
// xinef: fix from db
|
||||
if ((addToMap || gridLoad) && !data->overwrittenZ)
|
||||
{
|
||||
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 1.0f, true);
|
||||
if (tz >= data->posZ && tz - data->posZ <= 1.0f)
|
||||
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 0.42f, true);
|
||||
if (tz >= data->posZ && tz - data->posZ <= 0.42f)
|
||||
const_cast<CreatureData*>(data)->posZ = tz + 0.1f;
|
||||
|
||||
const_cast<CreatureData*>(data)->overwrittenZ = true;
|
||||
|
||||
Reference in New Issue
Block a user