summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-07-07 15:39:46 +0000
committerfrosch <frosch@openttd.org>2012-07-07 15:39:46 +0000
commit08a8c3a773e9c730bd92a39e1e07403a172e866a (patch)
tree5fea4034f5d65bf6be9c28458ce05369d702a78d /src/vehicle_cmd.cpp
parent8d004f3c63fbff4f3524f770483db90408a98c50 (diff)
downloadopenttd-08a8c3a773e9c730bd92a39e1e07403a172e866a.tar.xz
(svn r24384) -Fix [FS#5188-ish]: Make IsInDepot() functions behave consistent across vehicle types and add IsChainInDepot instead, if that is what shall be checked.
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index cf225a210..bfcdb6862 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -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);