(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:
@@ -159,7 +159,9 @@ static void CheckIfShipNeedsService(Vehicle *v)
|
||||
|
||||
Money Ship::GetRunningCost() const
|
||||
{
|
||||
return GetVehicleProperty(this, PROP_SHIP_RUNNING_COST_FACTOR, ShipVehInfo(this->engine_type)->running_cost) * _price[PR_RUNNING_SHIP];
|
||||
const Engine *e = Engine::Get(this->engine_type);
|
||||
uint cost_factor = GetVehicleProperty(this, PROP_SHIP_RUNNING_COST_FACTOR, e->u.ship.running_cost);
|
||||
return GetPrice(PR_RUNNING_SHIP, cost_factor);
|
||||
}
|
||||
|
||||
void Ship::OnNewDay()
|
||||
|
Reference in New Issue
Block a user