diff options
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index ac6fa1d22..251b42729 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -87,6 +87,15 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { uint GetDisplayWeight() const; uint GetDisplayMaxTractiveEffort() const; Date GetLifeLengthInDays() const; + + /** + * Check if the engine is a ground vehicle. + * @return True iff the engine is a train or a road vehicle. + */ + FORCEINLINE bool IsGroundVehicle() const + { + return this->type == VEH_TRAIN || this->type == VEH_ROAD; + } }; struct EngineIDMapping { |