(svn r18005) -Codechange: Convert the Prices struct into an array and an enum.

This commit is contained in:
frosch
2009-11-07 22:47:54 +00:00
parent 7984d90c40
commit ba1fc280e3
30 changed files with 249 additions and 242 deletions

View File

@@ -30,7 +30,7 @@
if (!IsValidAirportType(type)) return -1;
const AirportFTAClass *afc = ::GetAirport(type);
return _price.build_airport * afc->size_x * afc->size_y;
return _price[PR_BUILD_STATION_AIRPORT] * afc->size_x * afc->size_y;
}
/* static */ bool AIAirport::IsHangarTile(TileIndex tile)

View File

@@ -145,7 +145,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{
if (!IsValidBridge(bridge_id)) return -1;
return ::CalcBridgeLenCostFactor(length) * _price.build_bridge * ::GetBridgeSpec(bridge_id)->price >> 8;
return ::CalcBridgeLenCostFactor(length) * _price[PR_BUILD_BRIDGE] * ::GetBridgeSpec(bridge_id)->price >> 8;
}
/* static */ int32 AIBridge::GetMaxLength(BridgeID bridge_id)