summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-17 17:13:30 +0000
committerrubidium <rubidium@openttd.org>2009-06-17 17:13:30 +0000
commit35aabc1d4c6ab0f2095d3c40fd60dc446eb635b4 (patch)
treee18c37c6a966c185fda17a838a6de2b123bd1d60 /src/engine.cpp
parentd09d3566ddd86a559819354bad805dfc23622db8 (diff)
downloadopenttd-35aabc1d4c6ab0f2095d3c40fd60dc446eb635b4.tar.xz
(svn r16586) -Codechange: don't store lifelength in the savegame; it can easily be calculated, it isn't used often and now changing extend_vehicle_life in game has some effect.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index a9ad89db5..d39c86f6a 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -322,7 +322,7 @@ uint Engine::GetDisplayMaxTractiveEffort() const
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;
+ return (this->info.lifelength + _settings_game.vehicle.extend_vehicle_life) * DAYS_IN_LEAP_YEAR;
}
/**
@@ -516,8 +516,6 @@ void StartupOneEngine(Engine *e, Date aging_date)
CalcEngineReliability(e);
- e->lifelength = ei->lifelength + _settings_game.vehicle.extend_vehicle_life;
-
/* prevent certain engines from ever appearing. */
if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) {
e->flags |= ENGINE_AVAILABLE;