Beispiel #1
0
void Map::UpdatePlayerVisibility( Player* player, Cell cell, CellPair cellpair )
{
	
	cell.data.Part.reserved = CENTER_DISTRICT;

	LeGACY::PlayerNotifier pl_notifier(*player);
	TypeContainerVisitor<LeGACY::PlayerNotifier, WorldTypeMapContainer > player_notifier(pl_notifier);

	CellLock<ReadGuard> cell_lock(cell, cellpair);
	cell_lock->Visit(cell_lock, player_notifier, *this);
}
Beispiel #2
0
void
ObjectAccessor::_buildChangeObjectForPlayer(WorldObject *obj, UpdateDataMapType &update_players)
{
    CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
    Cell cell(p);
    cell.data.Part.reserved = ALL_DISTRICT;
    cell.SetNoCreate();
    WorldObjectChangeAccumulator notifier(*obj, update_players);
    TypeContainerVisitor<WorldObjectChangeAccumulator, WorldTypeMapContainer > player_notifier(notifier);
    CellLock<GridReadGuard> cell_lock(cell, p);
    cell_lock->Visit(cell_lock, player_notifier, *obj->GetMap());
}
void
ObjectAccessor::_buildChangeObjectForPlayer(WorldObject *obj, UpdateDataMapType &update_players)
{
    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
    Cell cell(p);
    cell.data.Part.reserved = ALL_DISTRICT;
    cell.SetNoCreate();
    WorldObjectChangeAccumulator notifier(*obj, update_players);
    TypeContainerVisitor<WorldObjectChangeAccumulator, WorldTypeMapContainer > player_notifier(notifier);
    CellLock<GridReadGuard> cell_lock(cell, p);
    Map& map = *obj->GetMap();
    //we must build packets for all visible players
    cell_lock->Visit(cell_lock, player_notifier, map, *obj, map.GetVisibilityDistance());
}