fix(Core/Creature): Remove automated z spawn correction (#18200)

* fix(Core/Creature): Remove automated z spawn correction

* comment out unused parameter

* remove gridLoad parameter from Creature::LoadCreatureFromDB()
This commit is contained in:
sudlud
2024-01-21 11:33:00 +01:00
committed by GitHub
parent a7e098af0c
commit e447351b0f
7 changed files with 10 additions and 21 deletions

View File

@@ -1627,7 +1627,7 @@ bool Creature::isVendorWithIconSpeak() const
return m_creatureInfo->IconName == "Speak" && m_creatureData->npcflag & UNIT_NPC_FLAG_VENDOR;
}
bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap, bool gridLoad, bool allowDuplicate /*= false*/)
bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap, bool allowDuplicate /*= false*/)
{
if (!allowDuplicate)
{
@@ -1666,16 +1666,6 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
return false;
}
// xinef: fix from db
if ((addToMap || gridLoad) && !data->overwrittenZ)
{
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;
}
// xinef: this has to be assigned before Create function, properly loads equipment id from DB
m_creatureData = data;
m_spawnId = spawnId;