mirror of https://github.com/OpenTTD/OpenTTD
(svn r27807) -Codechange: Remove _ship_leave_depot_offs
There is already TileOffsByDiagDir for that. (cirdan)release/1.8
parent
2a555480bd
commit
3c7dc746d5
|
@ -317,11 +317,6 @@ void Ship::UpdateDeltaXY(Direction direction)
|
||||||
this->z_extent = 6;
|
this->z_extent = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TileIndexDiffC _ship_leave_depot_offs[] = {
|
|
||||||
{-1, 0},
|
|
||||||
{ 0, -1}
|
|
||||||
};
|
|
||||||
|
|
||||||
static bool CheckShipLeaveDepot(Ship *v)
|
static bool CheckShipLeaveDepot(Ship *v)
|
||||||
{
|
{
|
||||||
if (!v->IsChainInDepot()) return false;
|
if (!v->IsChainInDepot()) return false;
|
||||||
|
@ -337,9 +332,9 @@ static bool CheckShipLeaveDepot(Ship *v)
|
||||||
Axis axis = GetShipDepotAxis(tile);
|
Axis axis = GetShipDepotAxis(tile);
|
||||||
|
|
||||||
DiagDirection north_dir = ReverseDiagDir(AxisToDiagDir(axis));
|
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);
|
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 north_tracks = DiagdirReachesTracks(north_dir) & GetTileShipTrackStatus(north_neighbour);
|
||||||
TrackBits south_tracks = DiagdirReachesTracks(south_dir) & GetTileShipTrackStatus(south_neighbour);
|
TrackBits south_tracks = DiagdirReachesTracks(south_dir) & GetTileShipTrackStatus(south_neighbour);
|
||||||
|
|
Loading…
Reference in New Issue