diff options
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r-- | src/game/ObjectAccessor.cpp | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 8d9f3f63fc2..75f0d697771 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -487,24 +487,10 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) } void -ObjectAccessor::AddActiveObject( WorldObject * obj ) -{ - i_activeobjects.insert(obj); -} - -void -ObjectAccessor::RemoveActiveObject( WorldObject * obj ) -{ - i_activeobjects.erase(obj); -} - -void ObjectAccessor::Update(uint32 diff) { - - { +/* { //Player update now in MapManager -> UpdatePlayers - /* // player update might remove the player from grid, and that causes crashes. We HAVE to update players first, and then the active objects. HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer(); for(HashMapHolder<Player>::MapType::iterator iter = playerMap.begin(); iter != playerMap.end(); ++iter) @@ -513,7 +499,7 @@ ObjectAccessor::Update(uint32 diff) { iter->second->Update(diff); } - }*/ + } // TODO: move this to Map::Update // clone the active object list, because update might remove from it @@ -574,7 +560,7 @@ ObjectAccessor::Update(uint32 diff) } } } - } + }*/ UpdateDataMapType update_players; { @@ -608,30 +594,6 @@ ObjectAccessor::UpdatePlayers(uint32 diff) iter->second->Update(diff); } -bool -ObjectAccessor::ActiveObjectsNearGrid(uint32 x, uint32 y, uint32 m_id, uint32 i_id) const -{ - CellPair cell_min(x*MAX_NUMBER_OF_CELLS, y*MAX_NUMBER_OF_CELLS); - CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS); - cell_min << 2; - cell_min -= 2; - cell_max >> 2; - cell_max += 2; - - for(std::set<WorldObject*>::const_iterator itr = i_activeobjects.begin(); itr != i_activeobjects.end(); ++itr) - { - if( m_id != (*itr)->GetMapId() || i_id != (*itr)->GetInstanceId() ) - continue; - - CellPair p = Trinity::ComputeCellPair((*itr)->GetPositionX(), (*itr)->GetPositionY()); - if( (cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) && - (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) ) - return true; - } - - return false; -} - void ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m) { |