@@ -667,15 +667,13 @@ CommandCost CmdMassStartStopVehicle(DoCo
} else {
if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_company)) return CMD_ERROR;
/* Get the list of vehicles in the depot */
BuildDepotVehicleList(vli.vtype, tile, &list, nullptr);
}
for (uint i = 0; i < list.size(); i++) {
const Vehicle *v = list[i];
for (const Vehicle *v : list) {
if (!!(v->vehstatus & VS_STOPPED) != do_start) continue;
if (!vehicle_list_window && !v->IsChainInDepot()) continue;
/* Just try and don't care if some vehicle's can't be stopped. */
Command<CMD_START_STOP_VEHICLE>::Do(flags, v->index, false);
@@ -702,14 +700,14 @@ CommandCost CmdDepotSellAllVehicles(DoCo
BuildDepotVehicleList(vehicle_type, tile, &list, &list);
CommandCost last_error = CMD_ERROR;
bool had_success = false;
CommandCost ret = Command<CMD_SELL_VEHICLE>::Do(flags, list[i]->index, true, false, INVALID_CLIENT_ID);
CommandCost ret = Command<CMD_SELL_VEHICLE>::Do(flags, v->index, true, false, INVALID_CLIENT_ID);
if (ret.Succeeded()) {
cost.AddCost(ret);
had_success = true;
last_error = ret;
@@ -733,15 +731,13 @@ CommandCost CmdDepotMassAutoReplace(DoCo
if (!IsCompanyBuildableVehicleType(vehicle_type)) return CMD_ERROR;
BuildDepotVehicleList(vehicle_type, tile, &list, &list, true);
/* Ensure that the vehicle completely in the depot */
if (!v->IsChainInDepot()) continue;
CommandCost ret = Command<CMD_AUTOREPLACE_VEHICLE>::Do(flags, v->index);
if (ret.Succeeded()) cost.AddCost(ret);
Status change: