summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
committerterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
commit79e2b3153d4d89a653a72e07727e58300b435ac4 (patch)
tree62d1f676a9a63df00b92b64d8e866a98b080dc3b /src/vehicle_base.h
parent96b98b392ad89e3d1718a7a46a3e41d4eeab61d3 (diff)
downloadopenttd-79e2b3153d4d89a653a72e07727e58300b435ac4.tar.xz
(svn r21516) -Codechange: Add IsGroundVehicle function to the Vehicle class.
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
*/