* Remove bus or truck stops. * @param flags Operation to perform. * @param tile Northernmost tile of the removal area. * @param width Width of the removal area. * @param height Height of the removal area. * @param stop_type Type of stop (bus/truck). * @param remove_road Remove roads of drive-through stops? * @return The cost of this operation or an error. */
| 2481 | * @return The cost of this operation or an error. |
| 2482 | */ |
| 2483 | CommandCost CmdRemoveRoadStop(DoCommandFlags flags, TileIndex tile, uint8_t width, uint8_t height, RoadStopType stop_type, bool remove_road) |
| 2484 | { |
| 2485 | if (stop_type >= RoadStopType::End) return CMD_ERROR; |
| 2486 | /* Check for incorrect width / height. */ |
| 2487 | if (width == 0 || height == 0) return CMD_ERROR; |
| 2488 | /* Check if the first tile and the last tile are valid */ |
| 2489 | if (!IsValidTile(tile) || TileAddWrap(tile, width - 1, height - 1) == INVALID_TILE) return CMD_ERROR; |
| 2490 | /* Bankrupting company is not supposed to remove roads, there may be road vehicles. */ |
| 2491 | if (remove_road && flags.Test(DoCommandFlag::Bankrupt)) return CMD_ERROR; |
| 2492 | |
| 2493 | TileArea roadstop_area(tile, width, height); |
| 2494 | |
| 2495 | return RemoveGenericRoadStop(flags, roadstop_area, false, remove_road); |
| 2496 | } |
| 2497 | |
| 2498 | /** |
| 2499 | * Remove road waypoints. |
nothing calls this directly
no test coverage detected