summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-13 00:43:35 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-13 00:43:35 +0000
commitdef8e7215bdabee99ad49adedb8730ae33b6c47f (patch)
tree77accd58c6e79e746605fdf851b84720c7600836 /src/engine.cpp
parent686f51d810f9fa8303639c979f0ba76f1993ce9b (diff)
downloadopenttd-def8e7215bdabee99ad49adedb8730ae33b6c47f.tar.xz
(svn r23504) -Feature: Aircraft range.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index c90d13297..a5ed31fd5 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -449,6 +449,20 @@ Date Engine::GetLifeLengthInDays() const
}
/**
+ * Get the range of an aircraft type.
+ * @return Range of the aircraft type in tiles or 0 if unlimited range.
+ */
+uint16 Engine::GetRange() const
+{
+ switch (this->type) {
+ case VEH_AIRCRAFT:
+ return GetEngineProperty(this->index, PROP_AIRCRAFT_RANGE, this->u.air.max_range);
+
+ default: NOT_REACHED();
+ }
+}
+
+/**
* Initializes the EngineOverrideManager with the default engines.
*/
void EngineOverrideManager::ResetToDefaultMapping()