diff options
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 1bdbf9a2c..c9bfb98b9 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -291,42 +291,6 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) return cost; } -/** Start/Stop a road vehicle. - * @param tile unused - * @param flags operation to perform - * @param p1 road vehicle ID to start/stop - * @param p2 unused - */ -CommandCost CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) -{ - if (!IsValidVehicleID(p1)) return CMD_ERROR; - - Vehicle *v = GetVehicle(p1); - - if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR; - - /* Check if this road veh can be started/stopped. The callback will fail or - * return 0xFF if it can. */ - uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v); - if (callback != CALLBACK_FAILED && GB(callback, 0, 8) != 0xFF) { - StringID error = GetGRFStringID(GetEngineGRFID(v->engine_type), 0xD000 + callback); - return_cmd_error(error); - } - - if (flags & DC_EXEC) { - if (v->IsStoppedInDepot()) { - DeleteVehicleNews(p1, STR_9016_ROAD_VEHICLE_IS_WAITING); - } - - v->vehstatus ^= VS_STOPPED; - v->cur_speed = 0; - InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); - InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); - } - - return CommandCost(); -} - void ClearSlot(Vehicle *v) { RoadStop *rs = v->u.road.slot; |