src/yapf/yapf_costbase.hpp
changeset 8579 3efbb430092e
parent 5726 8f399788f6c9
child 8875 ffcab947226b
equal deleted inserted replaced
8578:55218950ce2d 8579:3efbb430092e
     9 	FORCEINLINE static bool stSlopeCost(TileIndex tile, Trackdir td)
     9 	FORCEINLINE static bool stSlopeCost(TileIndex tile, Trackdir td)
    10 	{
    10 	{
    11 		if (IsDiagonalTrackdir(td)) {
    11 		if (IsDiagonalTrackdir(td)) {
    12 			if (IsBridgeTile(tile)) {
    12 			if (IsBridgeTile(tile)) {
    13 				// it is bridge ramp, check if we are entering the bridge
    13 				// it is bridge ramp, check if we are entering the bridge
    14 				if (GetBridgeRampDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
    14 				if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
    15 				// we are entering the bridge
    15 				// we are entering the bridge
    16 				// if the tile slope is downwards, then bridge ramp has not upward slope
    16 				// if the tile slope is downwards, then bridge ramp has not upward slope
    17 				uint tile_slope = GetTileSlope(tile, NULL) & 0x0F;
    17 				uint tile_slope = GetTileSlope(tile, NULL) & 0x0F;
    18 				if ((c_upwards_slopes[tile_slope] & TrackdirToTrackdirBits(ReverseTrackdir(td))) != 0) return false; // tile under ramp goes down, no penalty
    18 				if ((c_upwards_slopes[tile_slope] & TrackdirToTrackdirBits(ReverseTrackdir(td))) != 0) return false; // tile under ramp goes down, no penalty
    19 				// tile under ramp isn't going down, so ramp must go up
    19 				// tile under ramp isn't going down, so ramp must go up