From ebe81b98ce72768feadfdf562931b4ff59e13ff3 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 7 May 2007 13:26:10 +0000 Subject: (svn r9806) -Codechange: [NewGRF] Add callback 36 support for purchase cost, for all vehicle types. --- src/aircraft_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/aircraft_cmd.cpp') diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index fa4ec2c3c..3dfca75bb 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -227,9 +227,9 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height) height = spr->height; } -static int32 EstimateAircraftCost(const AircraftVehicleInfo *avi) +static int32 EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi) { - return avi->base_cost * (_price.aircraft_base >> 3) >> 5; + return GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5; } @@ -270,7 +270,7 @@ int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (!IsEngineBuildable(p1, VEH_AIRCRAFT, _current_player)) return_cmd_error(STR_AIRCRAFT_NOT_AVAILABLE); const AircraftVehicleInfo *avi = AircraftVehInfo(p1); - int32 value = EstimateAircraftCost(avi); + int32 value = EstimateAircraftCost(p1, avi); /* to just query the cost, it is not neccessary to have a valid tile (automation/AI) */ if (flags & DC_QUERY_COST) return value; -- cgit v1.2.3-54-g00ecf