Mercurial > hg > openttd
changeset 19478:96a2f0d3d7ba draft
(svn r24381) -Revert (r24380): RoadVehicle::IsInDepot was supposed to behave different to Train::IsInDepot.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 07 Jul 2012 15:22:21 +0000 |
parents | 499ccb0e2425 |
children | 5c205cdec645 |
files | src/roadveh.h src/roadveh_cmd.cpp |
diffstat | 2 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/roadveh.h +++ b/src/roadveh.h @@ -112,7 +112,7 @@ 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();
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -308,15 +308,10 @@ bool RoadVehicle::IsStoppedInDepot() const { - if (this->IsFrontEngine() && !(this->vehstatus & VS_STOPPED)) return false; - - return this->IsInDepot(); -} + TileIndex tile = this->tile; -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;