mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r24381) -Revert (r24380): RoadVehicle::IsInDepot was supposed to behave different to Train::IsInDepot.
This commit is contained in:
parent
00a84fc4ce
commit
e4f0539cae
@ -112,7 +112,7 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
|
||||
int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed / 2; }
|
||||
Money GetRunningCost() const;
|
||||
int GetDisplayImageWidth(Point *offset = NULL) const;
|
||||
bool IsInDepot() const;
|
||||
bool IsInDepot() const { return this->state == RVSB_IN_DEPOT; }
|
||||
bool IsStoppedInDepot() const;
|
||||
bool Tick();
|
||||
void OnNewDay();
|
||||
|
@ -307,16 +307,11 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user