diff options
author | frosch <frosch@openttd.org> | 2009-11-24 13:12:34 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-24 13:12:34 +0000 |
commit | 912bce0b8cdeca9849dd257ca95566b009719d53 (patch) | |
tree | a2abd63725a9c6baffb22a8b3c39dc6b2f535dfb /src/aircraft_cmd.cpp | |
parent | b6b551533532d64f47e883d770b9633027ca7628 (diff) | |
download | openttd-912bce0b8cdeca9849dd257ca95566b009719d53.tar.xz |
(svn r18266) -Codechange: Add a function to compute prices from price base and cost factor and use it consistently for vehicle purchase, running cost, and refit cost.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 22a3872a5..159033199 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -540,7 +540,9 @@ static void CheckIfAircraftNeedsService(Aircraft *v) Money Aircraft::GetRunningCost() const { - return GetVehicleProperty(this, PROP_AIRCRAFT_RUNNING_COST_FACTOR, AircraftVehInfo(this->engine_type)->running_cost) * _price[PR_RUNNING_AIRCRAFT]; + const Engine *e = Engine::Get(this->engine_type); + uint cost_factor = GetVehicleProperty(this, PROP_AIRCRAFT_RUNNING_COST_FACTOR, e->u.air.running_cost); + return GetPrice(PR_RUNNING_AIRCRAFT, cost_factor); } void Aircraft::OnNewDay() |