summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index 642b80424..d81713d74 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -360,6 +360,15 @@ public:
}
/**
+ * Check if the vehicle is a ground vehicle.
+ * @return True iff the vehicle is a train or a road vehicle.
+ */
+ FORCEINLINE bool IsGroundVehicle() const
+ {
+ return this->type == VEH_TRAIN || this->type == VEH_ROAD;
+ }
+
+ /**
* Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
* @return the vehicle's speed
*/