(svn r24380) -Fix [FS#5188]: RoadVehicle::IsInDepot did not check all articulated parts.
This commit is contained in:
@@ -308,11 +308,16 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
|
||||
|
||||
bool RoadVehicle::IsStoppedInDepot() const
|
||||
{
|
||||
TileIndex tile = this->tile;
|
||||
|
||||
if (!IsRoadDepotTile(tile)) return false;
|
||||
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;
|
||||
|
||||
for (const RoadVehicle *v = this; v != NULL; v = v->Next()) {
|
||||
if (v->state != RVSB_IN_DEPOT || v->tile != tile) return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user