Add: AI/GS GetMonthlyMaintenanceCost (#6897)

API addition which allows AI/GS scripts to retrieve the monthly maintenance cost of an airport type.
This commit is contained in:
Samu
2018-09-14 13:03:52 +01:00
committed by Niels Martin Hansen
parent 4703cd433d
commit 1e68b9b3e6
6 changed files with 20 additions and 0 deletions

View File

@@ -163,3 +163,10 @@
return AirportSpec::Get(type)->maintenance_cost;
}
/* static */ Money ScriptAirport::GetMonthlyMaintenanceCost(AirportType type)
{
if (!IsAirportInformationAvailable(type)) return -1;
return (int64)GetMaintenanceCostFactor(type) * _price[PR_INFRASTRUCTURE_AIRPORT] >> 3;
}