diff options
author | smatz <smatz@openttd.org> | 2009-01-13 22:58:03 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-01-13 22:58:03 +0000 |
commit | e00cf92f47837d26d5b0fffb0668c5c717b3bacc (patch) | |
tree | 30732aa7126b9196722d14cee835443a82b9688b /src/engine.cpp | |
parent | cb221d99969240913f61d3bd64e20425568044d2 (diff) | |
download | openttd-e00cf92f47837d26d5b0fffb0668c5c717b3bacc.tar.xz |
(svn r15077) -Codechange: enumify DAYS_IN_YEAR and DAYS_IN_LEAP_YEAR
-Change: when computing daily running cost, divide by 365 (instead of 364). Since r12134, the rounding errors don't need this correction anymore
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index ffecb7bac..d35e9df54 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -246,7 +246,7 @@ void SetYearEngineAgingStops() /* Base year ending date on half the model life */ YearMonthDay ymd; - ConvertDateToYMD(ei->base_intro + (ei->lifelength * 366) / 2, &ymd); + ConvertDateToYMD(ei->base_intro + (ei->lifelength * DAYS_IN_LEAP_YEAR) / 2, &ymd); _year_engine_aging_stops = max(_year_engine_aging_stops, ymd.year); } @@ -475,7 +475,7 @@ void EnginesMonthlyLoop() CalcEngineReliability(e); } - if (!(e->flags & ENGINE_AVAILABLE) && _date >= (e->intro_date + 365)) { + if (!(e->flags & ENGINE_AVAILABLE) && _date >= (e->intro_date + DAYS_IN_YEAR)) { /* Introduce it to all companies */ NewVehicleAvailable(e); } else if (!(e->flags & (ENGINE_AVAILABLE|ENGINE_EXCLUSIVE_PREVIEW)) && _date >= e->intro_date) { |