mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-23 04:04:09 +01:00
(svn r24424) [1.2] -Backport from trunk:
- Fix: Use the 'all vehicles' group for the autoreplace window from the vehicle list [FS#5239] (r24392) - Fix: Do not consider not finding a particular base set critical; just load a different one and display an in-game error later on [FS#5233] (r24388) - Fix: Make IsInDepot() functions behave consistent across vehicle types and add IsChainInDepot instead, if that is what shall be checked [FS#5188] (r24384) - Fix: Call Vehicle::IsStoppedInDepot only for the first vehicle in a chain (i.e. primary vehicle or free wagon) (r24382) - Fix: Do not resize the object GUI when selecting objects. Rather clip the object name (r24379)
This commit is contained in:
@@ -601,13 +601,7 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32
|
||||
|
||||
if (!!(v->vehstatus & VS_STOPPED) != do_start) continue;
|
||||
|
||||
if (!vehicle_list_window) {
|
||||
if (vli.vtype == VEH_TRAIN) {
|
||||
if (!Train::From(v)->IsInDepot()) continue;
|
||||
} else {
|
||||
if (!(v->vehstatus & VS_HIDDEN)) continue;
|
||||
}
|
||||
}
|
||||
if (!vehicle_list_window && !v->IsChainInDepot()) continue;
|
||||
|
||||
/* Just try and don't care if some vehicle's can't be stopped. */
|
||||
DoCommand(tile, v->index, 0, flags, CMD_START_STOP_VEHICLE);
|
||||
@@ -679,7 +673,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32
|
||||
const Vehicle *v = list[i];
|
||||
|
||||
/* Ensure that the vehicle completely in the depot */
|
||||
if (!v->IsInDepot()) continue;
|
||||
if (!v->IsChainInDepot()) continue;
|
||||
|
||||
CommandCost ret = DoCommand(0, v->index, 0, flags, CMD_AUTOREPLACE_VEHICLE);
|
||||
|
||||
@@ -991,6 +985,7 @@ CommandCost CmdSendVehicleToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1
|
||||
|
||||
Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20));
|
||||
if (v == NULL) return CMD_ERROR;
|
||||
if (!v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||
|
||||
return v->SendToDepot(flags, (DepotCommand)(p1 & DEPOT_COMMAND_MASK));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user