summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 2c06f7897..f29efb60a 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -308,15 +308,10 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
bool RoadVehicle::IsStoppedInDepot() const
{
- 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;