Changeset - r22596:d66173d9fdc5
[Not reviewed]
master
0 1 0
peter1138 - 7 years ago 2017-03-19 22:02:20
peter1138@openttd.org
(svn r27807) -Codechange: Remove _ship_leave_depot_offs

There is already TileOffsByDiagDir for that. (cirdan)
1 file changed with 2 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/ship_cmd.cpp
Show inline comments
 
@@ -317,11 +317,6 @@ void Ship::UpdateDeltaXY(Direction direc
 
	this->z_extent      = 6;
 
}
 

	
 
static const TileIndexDiffC _ship_leave_depot_offs[] = {
 
	{-1,  0},
 
	{ 0, -1}
 
};
 

	
 
static bool CheckShipLeaveDepot(Ship *v)
 
{
 
	if (!v->IsChainInDepot()) return false;
 
@@ -337,9 +332,9 @@ static bool CheckShipLeaveDepot(Ship *v)
 
	Axis axis = GetShipDepotAxis(tile);
 

	
 
	DiagDirection north_dir = ReverseDiagDir(AxisToDiagDir(axis));
 
	TileIndex north_neighbour = TILE_ADD(tile, ToTileIndexDiff(_ship_leave_depot_offs[axis]));
 
	TileIndex north_neighbour = TILE_ADD(tile, TileOffsByDiagDir(north_dir));
 
	DiagDirection south_dir = AxisToDiagDir(axis);
 
	TileIndex south_neighbour = TILE_ADD(tile, -2 * ToTileIndexDiff(_ship_leave_depot_offs[axis]));
 
	TileIndex south_neighbour = TILE_ADD(tile, 2 * TileOffsByDiagDir(south_dir));
 

	
 
	TrackBits north_tracks = DiagdirReachesTracks(north_dir) & GetTileShipTrackStatus(north_neighbour);
 
	TrackBits south_tracks = DiagdirReachesTracks(south_dir) & GetTileShipTrackStatus(south_neighbour);
0 comments (0 inline, 0 general)