Add setting for whether to show vehicle running costs per calendar year
See #660
This commit is contained in:
@@ -4353,6 +4353,17 @@ void Vehicle::SetNext(Vehicle *next)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the running cost of a vehicle that can be sent into SetDParam for string processing.
|
||||
* @return the vehicle's running cost
|
||||
*/
|
||||
Money Vehicle::GetDisplayRunningCost() const
|
||||
{
|
||||
Money cost = this->GetRunningCost() >> 8;
|
||||
if (_settings_client.gui.show_running_costs_calendar_year) cost *= DayLengthFactor();
|
||||
return cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds this vehicle to a shared vehicle chain.
|
||||
* @param shared_chain a vehicle of the chain with shared vehicles.
|
||||
|
||||
Reference in New Issue
Block a user