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/ship_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ship_cmd.cpp') diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index a927dd542..ca400db87 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -172,7 +172,7 @@ void Ship::OnNewDay() if (this->running_ticks == 0) return; - CommandCost cost(EXPENSES_SHIP_RUN, GetVehicleProperty(this, 0x0F, ShipVehInfo(this->engine_type)->running_cost) * _price.ship_running * this->running_ticks / (364 * DAY_TICKS)); + CommandCost cost(EXPENSES_SHIP_RUN, GetVehicleProperty(this, 0x0F, ShipVehInfo(this->engine_type)->running_cost) * _price.ship_running * this->running_ticks / (DAYS_IN_YEAR * DAY_TICKS)); this->profit_this_year -= cost.GetCost(); this->running_ticks = 0; @@ -795,7 +795,7 @@ CommandCost CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, con 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; _new_vehicle_id = v->index; v->name = NULL; -- cgit v1.2.3-54-g00ecf