summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-07 13:26:10 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-07 13:26:10 +0000
commit4591fb5b0d7f9ade45093a86d6a7150c80414dc5 (patch)
tree5f24fcf49bbf30b6652cc9804840346fce6e2eec /src/aircraft_cmd.cpp
parent0de85b7eb0375f3b857c10fc172f3894a906d758 (diff)
downloadopenttd-4591fb5b0d7f9ade45093a86d6a7150c80414dc5.tar.xz
(svn r9806) -Codechange: [NewGRF] Add callback 36 support for purchase cost, for all vehicle types.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
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;