summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-16 13:52:18 +0000
committerrubidium <rubidium@openttd.org>2009-06-16 13:52:18 +0000
commit512b021e261f042dccd9bdc254cd470a46e575f5 (patch)
treee78a9754bf6d326bf90b988cbe69ed74a6a763b4 /src/engine.cpp
parent4b05617c42c89a323560a0bfd9225fcac9b69588 (diff)
downloadopenttd-512b021e261f042dccd9bdc254cd470a46e575f5.tar.xz
(svn r16581) -Codechange: unify the access to Engine::lifelength.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index bc0fb8a52..a9ad89db5 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -316,6 +316,16 @@ uint Engine::GetDisplayMaxTractiveEffort() const
}
/**
+ * Returns the vehicle's life length in days.
+ * @return the life length
+ */
+Date Engine::GetLifeLengthInDays() const
+{
+ /* Assume leap years; this gives the player a bit more than the given amount of years, but never less. */
+ return this->lifelength * DAYS_IN_LEAP_YEAR;
+}
+
+/**
* Initializes the EngineOverrideManager with the default engines.
*/
void EngineOverrideManager::ResetToDefaultMapping()