From 08a8c3a773e9c730bd92a39e1e07403a172e866a Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 7 Jul 2012 15:39:46 +0000 Subject: (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. --- src/roadveh_cmd.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/roadveh_cmd.cpp') 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; } -- cgit v1.2.3-54-g00ecf