summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ship_cmd.cpp9
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);