diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-12-10 15:21:55 +0100 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-12-10 15:21:55 +0100 |
commit | b1c8226d58ecdda9a9af5b4e3e8d88c1d44f589f (patch) | |
tree | ed9d70ffb03d5a85fd8abe4ea618a20a5b297635 /src/server/game/Grids/ObjectGridLoader.cpp | |
parent | fe69bd654a424f560f37774d5c3e763fd6589607 (diff) | |
parent | 11fb0beaf0cb877b14f24aa88f19832e0aa3dc88 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.x
Diffstat (limited to 'src/server/game/Grids/ObjectGridLoader.cpp')
-rwxr-xr-x | src/server/game/Grids/ObjectGridLoader.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 56c6410e6d7..cc5e3f5158a 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -44,6 +44,7 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m) } // for loading world object at grid loading (Corpses) +//TODO: to implement npc on transport, also need to load npcs at grid loading class ObjectWorldLoader { public: @@ -138,38 +139,23 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapTyp void ObjectGridLoader::Visit(GameObjectMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - + CellCoord cellCoord = i_cell.GetCellCoord(); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId()); LoadHelper(cell_guids.gameobjects, cellCoord, m, i_gameObjects, i_map); } -void -ObjectGridLoader::Visit(CreatureMapType &m) +void ObjectGridLoader::Visit(CreatureMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - + CellCoord cellCoord = i_cell.GetCellCoord(); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId()); LoadHelper(cell_guids.creatures, cellCoord, m, i_creatures, i_map); } void ObjectWorldLoader::Visit(CorpseMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - + CellCoord cellCoord = i_cell.GetCellCoord(); // corpses are always added to spawn mode 0 and they are spawned by their instance id - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), 0, cell_id); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), 0, cellCoord.GetId()); LoadHelper(cell_guids.corpses, cellCoord, m, i_corpses, i_map); } |