From 912bce0b8cdeca9849dd257ca95566b009719d53 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 24 Nov 2009 13:12:34 +0000 Subject: (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. --- src/aircraft_cmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/aircraft_cmd.cpp') 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() -- cgit v1.2.3-54-g00ecf