summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-07-07 12:48:53 +0000
committerfrosch <frosch@openttd.org>2012-07-07 12:48:53 +0000
commitc1dd0107c71270e8949ddefac41424b3dd79eca4 (patch)
tree516e2b952b401221fae31d700916c0a90ecde1ec /src/roadveh_cmd.cpp
parent3d3ab26ee6a2748cab201b21280042420732eb08 (diff)
downloadopenttd-c1dd0107c71270e8949ddefac41424b3dd79eca4.tar.xz
(svn r24380) -Fix [FS#5188]: RoadVehicle::IsInDepot did not check all articulated parts.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index f29efb60a..2c06f7897 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -308,10 +308,15 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
bool RoadVehicle::IsStoppedInDepot() const
{
- TileIndex tile = this->tile;
+ if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false;
+
+ return this->IsInDepot();
+}
+bool RoadVehicle::IsInDepot() 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;