mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 06:25:55 +00:00
fix(Core/Grids): Grid improvements (#20955)
This commit is contained in:
@@ -2341,8 +2341,8 @@ void ObjectMgr::AddCreatureToGrid(ObjectGuid::LowType guid, CreatureData const*
|
||||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
GridCoord gridCoord = Acore::ComputeGridCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][gridCoord.GetId()];
|
||||
cell_guids.creatures.insert(guid);
|
||||
}
|
||||
}
|
||||
@@ -2355,8 +2355,8 @@ void ObjectMgr::RemoveCreatureFromGrid(ObjectGuid::LowType guid, CreatureData co
|
||||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
GridCoord gridCoord = Acore::ComputeGridCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][gridCoord.GetId()];
|
||||
cell_guids.creatures.erase(guid);
|
||||
}
|
||||
}
|
||||
@@ -2454,7 +2454,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 mapId, float x, float y, float
|
||||
AddCreatureToGrid(spawnId, &data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
if (!map->Instanceable() && !map->IsRemovalGrid(x, y))
|
||||
if (!map->Instanceable() && !map->IsGridCreated(x, y))
|
||||
{
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->LoadCreatureFromDB(spawnId, map, true, true))
|
||||
@@ -2644,8 +2644,8 @@ void ObjectMgr::AddGameobjectToGrid(ObjectGuid::LowType guid, GameObjectData con
|
||||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
GridCoord gridCoord = Acore::ComputeGridCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][gridCoord.GetId()];
|
||||
cell_guids.gameobjects.insert(guid);
|
||||
}
|
||||
}
|
||||
@@ -2658,8 +2658,8 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat
|
||||
{
|
||||
if (mask & 1)
|
||||
{
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()];
|
||||
GridCoord gridCoord = Acore::ComputeGridCoord(data->posX, data->posY);
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(data->mapid, i)][gridCoord.GetId()];
|
||||
cell_guids.gameobjects.erase(guid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user