|
@@ -141,13 +141,13 @@ CommandCost CmdMassStartStopVehicle(Tile
|
|
|
if (!IsCompanyBuildableVehicleType(vehicle_type)) return CMD_ERROR;
|
|
|
|
|
|
if (vehicle_list_window) {
|
|
|
uint32 id = p1;
|
|
|
uint16 window_type = p2 & VLW_MASK;
|
|
|
|
|
|
GenerateVehicleSortList(&list, vehicle_type, _current_company, id, window_type);
|
|
|
if (!GenerateVehicleSortList(&list, vehicle_type, _current_company, id, window_type)) return CMD_ERROR;
|
|
|
} else {
|
|
|
/* Get the list of vehicles in the depot */
|
|
|
BuildDepotVehicleList(vehicle_type, tile, &list, NULL);
|
|
|
}
|
|
|
|
|
|
for (uint i = 0; i < list.Length(); i++) {
|
|
@@ -593,13 +593,13 @@ CommandCost CmdCloneVehicle(TileIndex ti
|
|
|
* @return 0 for success and CMD_ERROR if no vehicle is able to go to depot
|
|
|
*/
|
|
|
CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool service, Owner owner, uint16 vlw_flag, uint32 id)
|
|
|
{
|
|
|
VehicleList list;
|
|
|
|
|
|
GenerateVehicleSortList(&list, type, owner, id, vlw_flag);
|
|
|
if (!GenerateVehicleSortList(&list, type, owner, id, vlw_flag)) return CMD_ERROR;
|
|
|
|
|
|
/* Send all the vehicles to a depot */
|
|
|
bool had_success = false;
|
|
|
for (uint i = 0; i < list.Length(); i++) {
|
|
|
const Vehicle *v = list[i];
|
|
|
CommandCost ret = DoCommand(v->tile, v->index, (service ? 1 : 0) | DEPOT_DONT_CANCEL, flags, GetCmdSendToDepot(type));
|