* Get the axis for a new road waypoint. This means that if it is a valid * tile to build a waypoint on it returns a valid Axis, otherwise an * invalid one. * @param tile the tile to look at. * @return the axis for the to-be-build waypoint. */
| 126 | * @return the axis for the to-be-build waypoint. |
| 127 | */ |
| 128 | Axis GetAxisForNewRoadWaypoint(TileIndex tile) |
| 129 | { |
| 130 | /* The axis for existing road waypoints is easy. */ |
| 131 | if (IsRoadWaypointTile(tile)) return GetDriveThroughStopAxis(tile); |
| 132 | |
| 133 | /* Non-plain road type, no valid axis for waypoints. */ |
| 134 | if (!IsNormalRoadTile(tile)) return INVALID_AXIS; |
| 135 | |
| 136 | RoadBits bits = GetAllRoadBits(tile); |
| 137 | |
| 138 | if ((bits & ROAD_Y) == 0) return AXIS_X; |
| 139 | if ((bits & ROAD_X) == 0) return AXIS_Y; |
| 140 | |
| 141 | return INVALID_AXIS; |
| 142 | } |
| 143 | |
| 144 | extern CommandCost ClearTile_Station(TileIndex tile, DoCommandFlags flags); |
| 145 |
no test coverage detected