Show
Ignore:
Timestamp:
11/22/08 00:36:29 (17 years ago)
Author:
yumileroy
Message:

Merge with 273 (aab191f73e46).

Original author: gvcoman
Date: 2008-11-21 19:16:19-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectAccessor.cpp

    r279 r281  
    488488 
    489489void 
    490 ObjectAccessor::AddActiveObject( WorldObject * obj ) 
    491 { 
    492     i_activeobjects.insert(obj); 
    493 } 
    494  
    495 void 
    496 ObjectAccessor::RemoveActiveObject( WorldObject * obj ) 
    497 { 
    498     i_activeobjects.erase(obj); 
    499 } 
    500  
    501 void 
    502490ObjectAccessor::Update(uint32 diff) 
    503491{ 
    504  
    505     { 
     492/*    { 
    506493        //Player update now in MapManager -> UpdatePlayers 
    507         /* 
    508494        // player update might remove the player from grid, and that causes crashes. We HAVE to update players first, and then the active objects. 
    509495        HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer(); 
     
    514500                iter->second->Update(diff); 
    515501            } 
    516         }*/ 
     502        } 
    517503 
    518504        // TODO: move this to Map::Update 
     
    575561            } 
    576562        } 
    577     } 
     563    }*/ 
    578564 
    579565    UpdateDataMapType update_players; 
     
    609595} 
    610596 
    611 bool 
    612 ObjectAccessor::ActiveObjectsNearGrid(uint32 x, uint32 y, uint32 m_id, uint32 i_id) const 
    613 { 
    614     CellPair cell_min(x*MAX_NUMBER_OF_CELLS, y*MAX_NUMBER_OF_CELLS); 
    615     CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS); 
    616     cell_min << 2; 
    617     cell_min -= 2; 
    618     cell_max >> 2; 
    619     cell_max += 2; 
    620  
    621     for(std::set<WorldObject*>::const_iterator itr = i_activeobjects.begin(); itr != i_activeobjects.end(); ++itr) 
    622     { 
    623         if( m_id != (*itr)->GetMapId() || i_id != (*itr)->GetInstanceId() ) 
    624             continue; 
    625  
    626         CellPair p = Trinity::ComputeCellPair((*itr)->GetPositionX(), (*itr)->GetPositionY()); 
    627         if( (cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) && 
    628             (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) ) 
    629             return true; 
    630     } 
    631  
    632     return false; 
    633 } 
    634  
    635597void 
    636598ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)