(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.
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user