diff options
author | frosch <frosch@openttd.org> | 2012-07-07 15:39:46 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-07-07 15:39:46 +0000 |
commit | 08a8c3a773e9c730bd92a39e1e07403a172e866a (patch) | |
tree | 5fea4034f5d65bf6be9c28458ce05369d702a78d /src/roadveh_cmd.cpp | |
parent | 8d004f3c63fbff4f3524f770483db90408a98c50 (diff) | |
download | openttd-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/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index eed844dfe..62eb67915 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -306,19 +306,6 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin return CommandCost(); } -bool RoadVehicle::IsStoppedInDepot() const -{ - TileIndex tile = this->tile; - - if (!IsRoadDepotTile(tile)) return false; - if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false; - - for (const RoadVehicle *v = this; v != NULL; v = v->Next()) { - if (v->state != RVSB_IN_DEPOT || v->tile != tile) return false; - } - return true; -} - static FindDepotData FindClosestRoadDepot(const RoadVehicle *v, int max_distance) { if (IsRoadDepotTile(v->tile)) return FindDepotData(v->tile, 0); @@ -1582,7 +1569,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v) { /* If we already got a slot at a stop, use that FIRST, and go to a depot later */ if (Company::Get(v->owner)->settings.vehicle.servint_roadveh == 0 || !v->NeedsAutomaticServicing()) return; - if (v->IsInDepot()) { + if (v->IsChainInDepot()) { VehicleServiceInDepot(v); return; } |