summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-13 22:58:03 +0000
committersmatz <smatz@openttd.org>2009-01-13 22:58:03 +0000
commite00cf92f47837d26d5b0fffb0668c5c717b3bacc (patch)
tree30732aa7126b9196722d14cee835443a82b9688b /src/aircraft_cmd.cpp
parentcb221d99969240913f61d3bd64e20425568044d2 (diff)
downloadopenttd-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/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index fd22460b2..ac6934837 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -377,7 +377,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2,
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;
_new_vehicle_id = v->index;
@@ -643,7 +643,7 @@ void Aircraft::OnNewDay()
if (this->running_ticks == 0) return;
- CommandCost cost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running * this->running_ticks / (364 * DAY_TICKS));
+ CommandCost cost(EXPENSES_AIRCRAFT_RUN, GetVehicleProperty(this, 0x0E, AircraftVehInfo(this->engine_type)->running_cost) * _price.aircraft_running * this->running_ticks / (DAYS_IN_YEAR * DAY_TICKS));
this->profit_this_year -= cost.GetCost();
this->running_ticks = 0;