diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -308,10 +308,15 @@ CommandCost CmdBuildRoadVehicle(TileInde 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;