diff options
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/train.h b/src/train.h index 5befad626..1983b99ff 100644 --- a/src/train.h +++ b/src/train.h @@ -248,6 +248,9 @@ void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2); byte FreightWagonMult(CargoID cargo); +int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped); +int CheckTrainStoppedInDepot(const Vehicle *v); + /** * This class 'wraps' Vehicle; you do not actually instantiate this class. * You create a Vehicle using AllocateVehicle, so it is added to the pool @@ -275,6 +278,8 @@ struct Train : public Vehicle { int GetDisplaySpeed() const { return this->cur_speed * 10 / 16; } int GetDisplayMaxSpeed() const { return this->u.rail.cached_max_speed * 10 / 16; } Money GetRunningCost() const; + bool IsInDepot() const { return CheckTrainInDepot(this, false) != -1; } + bool IsStoppedInDepot() const { return CheckTrainStoppedInDepot(this) >= 0; } void Tick(); }; |