summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-24 13:12:34 +0000
committerfrosch <frosch@openttd.org>2009-11-24 13:12:34 +0000
commit912bce0b8cdeca9849dd257ca95566b009719d53 (patch)
treea2abd63725a9c6baffb22a8b3c39dc6b2f535dfb /src/aircraft_cmd.cpp
parentb6b551533532d64f47e883d770b9633027ca7628 (diff)
downloadopenttd-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.cpp4
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()