diff options
author | megamage <none@none> | 2008-12-13 10:50:45 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-13 10:50:45 -0600 |
commit | 32dc92b2cd82927e24dca61f775f0dba144a1588 (patch) | |
tree | 0c4f36c4dd03f620841dd4cb88c03ac16f5e09fd /src/game/ObjectAccessor.cpp | |
parent | fc75674217e3e69c85cf6b142a1737499186b1cc (diff) |
*Do not let Illidan cast parasite on Akama.
*Some cell visit update.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r-- | src/game/ObjectAccessor.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 605d9827a01..7d51c4c0291 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -488,79 +488,6 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid) 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) - { - if(iter->second->IsInWorld()) - { - iter->second->Update(diff); - } - } - - // TODO: move this to Map::Update - // clone the active object list, because update might remove from it - std::set<WorldObject *> activeobjects(i_activeobjects); - - std::set<WorldObject *>::iterator itr, next; - for(itr = activeobjects.begin(); itr != activeobjects.end(); itr = next) - { - next = itr; - ++next; - if((*itr)->IsInWorld()) - (*itr)->GetMap()->resetMarkedCells(); - else - activeobjects.erase(itr); - } - - Map *map; - - Trinity::ObjectUpdater updater(diff); - // for creature - TypeContainerVisitor<Trinity::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater); - // for pets - TypeContainerVisitor<Trinity::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater); - - for(itr = activeobjects.begin(); itr != activeobjects.end(); ++itr) - { - WorldObject *obj = (*itr); - map = obj->GetMap(); - - CellPair standing_cell(Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY())); - - // Check for correctness of standing_cell, it also avoids problems with update_cell - if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) - continue; - - // the overloaded operators handle range checking - // so ther's no need for range checking inside the loop - CellPair begin_cell(standing_cell), end_cell(standing_cell); - begin_cell << 1; begin_cell -= 1; // upper left - end_cell >> 1; end_cell += 1; // lower right - - for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++) - { - for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++) - { - uint32 cell_id = (y * TOTAL_NUMBER_OF_CELLS_PER_MAP) + x; - if( !map->isCellMarked(cell_id) ) - { - CellPair cell_pair(x,y); - map->markCell(cell_id); - Cell cell(cell_pair); - cell.data.Part.reserved = CENTER_DISTRICT; - cell.SetNoCreate(); - CellLock<NullGuard> cell_lock(cell, cell_pair); - cell_lock->Visit(cell_lock, grid_object_update, *map); - cell_lock->Visit(cell_lock, world_object_update, *map); - } - } - } - } - }*/ - UpdateDataMapType update_players; { Guard guard(i_updateGuard); |