summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
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()