1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 17:49:10 +00:00

(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.

This commit is contained in:
rubidium
2009-06-17 17:13:30 +00:00
parent d09d3566dd
commit 35aabc1d4c
4 changed files with 23 additions and 28 deletions

View File

@@ -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;