mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
(svn r27807) -Codechange: Remove _ship_leave_depot_offs
There is already TileOffsByDiagDir for that. (cirdan)
This commit is contained in:
parent
2a555480bd
commit
3c7dc746d5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user