From e00cf92f47837d26d5b0fffb0668c5c717b3bacc Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 13 Jan 2009 22:58:03 +0000 Subject: (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 --- src/engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/engine.cpp') 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) { -- cgit v1.2.3-54-g00ecf