Changeset - r22848:fca1207f7d32
[Not reviewed]
master
0 6 0
J0anJosep - 7 years ago 2018-04-29 11:50:52
juanjo.ng.83@gmail.com
Codechange: Use TileAddBy(Diag)Dir when possible.
6 files changed with 6 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/map.cpp
Show inline comments
 
@@ -269,7 +269,7 @@ bool CircularTileSearch(TileIndex *tile,
 

	
 
		/* If tile test is not successful, get one tile up,
 
		 * ready for a test in first circle around center tile */
 
		*tile = TILE_ADD(*tile, TileOffsByDir(DIR_N));
 
		*tile = TileAddByDir(*tile, DIR_N);
 
		return CircularTileSearch(tile, size / 2, 1, 1, proc, user_data);
 
	} else {
 
		return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data);
src/pathfinder/follow_track.hpp
Show inline comments
 
@@ -219,8 +219,7 @@ protected:
 
		}
 

	
 
		/* normal or station tile, do one step */
 
		TileIndexDiff diff = TileOffsByDiagDir(m_exitdir);
 
		m_new_tile = TILE_ADD(m_old_tile, diff);
 
		m_new_tile = TileAddByDiagDir(m_old_tile, m_exitdir);
 

	
 
		/* special handling for stations */
 
		if (IsRailTT() && HasStationTileRail(m_new_tile)) {
src/pathfinder/yapf/yapf_ship.cpp
Show inline comments
 
@@ -69,7 +69,7 @@ public:
 
		}
 

	
 
		/* move back to the old tile/trackdir (where ship is coming from) */
 
		TileIndex src_tile = TILE_ADD(tile, TileOffsByDiagDir(ReverseDiagDir(enterdir)));
 
		TileIndex src_tile = TileAddByDiagDir(tile, ReverseDiagDir(enterdir));
 
		Trackdir trackdir = v->GetVehicleTrackdir();
 
		assert(IsValidTrackdir(trackdir));
 

	
src/roadveh_cmd.cpp
Show inline comments
 
@@ -1449,7 +1449,7 @@ again:
 
			/* Vehicle has arrived at a bay in a road stop */
 

	
 
			if (IsDriveThroughStopTile(v->tile)) {
 
				TileIndex next_tile = TILE_ADD(v->tile, TileOffsByDir(v->direction));
 
				TileIndex next_tile = TileAddByDir(v->tile, v->direction);
 

	
 
				/* Check if next inline bay is free and has compatible road. */
 
				if (RoadStop::IsDriveThroughRoadStopContinuation(v->tile, next_tile) && (GetRoadTypes(next_tile) & v->compatible_roadtypes) != 0) {
src/station_gui.cpp
Show inline comments
 
@@ -2208,7 +2208,7 @@ static const T *FindStationsNearby(TileA
 
	if (distant_join && min(ta.w, ta.h) >= _settings_game.station.station_spread) return NULL;
 
	uint max_dist = distant_join ? _settings_game.station.station_spread - min(ta.w, ta.h) : 1;
 

	
 
	TileIndex tile = TILE_ADD(ctx.tile, TileOffsByDir(DIR_N));
 
	TileIndex tile = TileAddByDir(ctx.tile, DIR_N);
 
	CircularTileSearch(&tile, max_dist, ta.w, ta.h, AddNearbyStation<T>, &ctx);
 

	
 
	return NULL;
src/water_cmd.cpp
Show inline comments
 
@@ -1218,7 +1218,7 @@ void ConvertGroundTilesIntoWaterTiles()
 
				default:
 
					uint dir;
 
					FOR_EACH_SET_BIT(dir, _flood_from_dirs[slope & ~SLOPE_STEEP]) {
 
						TileIndex dest = TILE_ADD(tile, TileOffsByDir((Direction)dir));
 
						TileIndex dest = TileAddByDir(tile, (Direction)dir);
 
						Slope slope_dest = GetTileSlope(dest) & ~SLOPE_STEEP;
 
						if (slope_dest == SLOPE_FLAT || IsSlopeWithOneCornerRaised(slope_dest)) {
 
							MakeShore(tile);
0 comments (0 inline, 0 general)