* Place a road waypoint. * @param tile Position to start dragging a waypoint. */
| 253 | * @param tile Position to start dragging a waypoint. |
| 254 | */ |
| 255 | static void PlaceRoad_Waypoint(TileIndex tile) |
| 256 | { |
| 257 | if (_remove_button_clicked) { |
| 258 | VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_ROAD_WAYPOINT); |
| 259 | return; |
| 260 | } |
| 261 | |
| 262 | Axis axis = GetAxisForNewRoadWaypoint(tile); |
| 263 | if (IsValidAxis(axis)) { |
| 264 | /* Valid tile for waypoints */ |
| 265 | VpStartPlaceSizing(tile, axis == AXIS_X ? VPM_X_LIMITED : VPM_Y_LIMITED, DDSP_BUILD_ROAD_WAYPOINT); |
| 266 | VpSetPlaceSizingLimit(_settings_game.station.station_spread); |
| 267 | } else { |
| 268 | /* Tile where we can't build road waypoints. This is always going to fail, |
| 269 | * but provides the user with a proper error message. */ |
| 270 | Command<CMD_BUILD_ROAD_WAYPOINT>::Post(STR_ERROR_CAN_T_BUILD_ROAD_WAYPOINT, tile, AXIS_X, 1, 1, ROADSTOP_CLASS_WAYP, 0, StationID::Invalid(), false); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Callback for placing a bus station. |
no test coverage detected