mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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
|
// xinef: fix from db
|
||||||
if ((addToMap || gridLoad) && !data->overwrittenZ)
|
if ((addToMap || gridLoad) && !data->overwrittenZ)
|
||||||
{
|
{
|
||||||
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 1.0f, true);
|
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 0.42f, true);
|
||||||
if (tz >= data->posZ && tz - data->posZ <= 1.0f)
|
if (tz >= data->posZ && tz - data->posZ <= 0.42f)
|
||||||
const_cast<CreatureData*>(data)->posZ = tz + 0.1f;
|
const_cast<CreatureData*>(data)->posZ = tz + 0.1f;
|
||||||
|
|
||||||
const_cast<CreatureData*>(data)->overwrittenZ = true;
|
const_cast<CreatureData*>(data)->overwrittenZ = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user