Mercurial > hg > openttd
diff src/train_cmd.cpp @ 10744:0118ca646690 draft
(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
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 13 Jan 2009 22:58:03 +0000 (2009-01-13) |
parents | 7edccbb67398 |
children | dcc9b146a749 |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -829,7 +829,7 @@ const Engine *e = GetEngine(p1); v->reliability = e->reliability; v->reliability_spd_dec = e->reliability_spd_dec; - v->max_age = e->lifelength * 366; + v->max_age = e->lifelength * DAYS_IN_LEAP_YEAR; v->name = NULL; v->u.rail.railtype = rvi->railtype; @@ -4456,7 +4456,7 @@ if (this->running_ticks != 0) { /* running costs */ - CommandCost cost(EXPENSES_TRAIN_RUN, this->GetRunningCost() * this->running_ticks / (364 * DAY_TICKS)); + CommandCost cost(EXPENSES_TRAIN_RUN, this->GetRunningCost() * this->running_ticks / (DAYS_IN_YEAR * DAY_TICKS)); this->profit_this_year -= cost.GetCost(); this->running_ticks = 0;