* Place a rail waypoint. * @param tile Position to start dragging a waypoint. */
| 166 | * @param tile Position to start dragging a waypoint. |
| 167 | */ |
| 168 | static void PlaceRail_Waypoint(TileIndex tile) |
| 169 | { |
| 170 | if (_remove_button_clicked) { |
| 171 | VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_STATION); |
| 172 | return; |
| 173 | } |
| 174 | |
| 175 | Axis axis = GetAxisForNewRailWaypoint(tile); |
| 176 | if (IsValidAxis(axis)) { |
| 177 | /* Valid tile for waypoints */ |
| 178 | VpStartPlaceSizing(tile, axis == AXIS_X ? VPM_X_LIMITED : VPM_Y_LIMITED, DDSP_BUILD_STATION); |
| 179 | VpSetPlaceSizingLimit(_settings_game.station.station_spread); |
| 180 | } else { |
| 181 | /* Tile where we can't build rail waypoints. This is always going to fail, |
| 182 | * but provides the user with a proper error message. */ |
| 183 | Command<CMD_BUILD_RAIL_WAYPOINT>::Post(STR_ERROR_CAN_T_BUILD_RAIL_WAYPOINT , tile, AXIS_X, 1, 1, STAT_CLASS_WAYP, 0, StationID::Invalid(), false); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | void CcStation(Commands, const CommandCost &result, TileIndex tile) |
| 188 | { |
no test coverage detected