diff options
author | peter1138 <peter1138@openttd.org> | 2017-03-19 22:02:20 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2017-03-19 22:02:20 +0000 |
commit | 3c7dc746d50d44240ba683f91e1f362f01272236 (patch) | |
tree | b6f8e17db30108e3457562d71b727e9d0d22d20e | |
parent | 2a555480bd7acdd7e8a1202ce4be983dedf9b7b3 (diff) | |
download | openttd-3c7dc746d50d44240ba683f91e1f362f01272236.tar.xz |
(svn r27807) -Codechange: Remove _ship_leave_depot_offs
There is already TileOffsByDiagDir for that. (cirdan)
-rw-r--r-- | src/ship_cmd.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 2235cc4b2..de1bf4f8c 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -317,11 +317,6 @@ void Ship::UpdateDeltaXY(Direction direction) 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); |