--- a/src/train_cmd.cpp Mon May 07 11:24:23 2007 +0000
+++ b/src/train_cmd.cpp Mon May 07 13:26:10 2007 +0000
@@ -566,7 +566,7 @@
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
const RailVehicleInfo *rvi = RailVehInfo(engine);
- int32 value = (rvi->base_cost * _price.build_railwagon) >> 8;
+ int32 value = (GetEngineProperty(engine, 0x17, rvi->base_cost) * _price.build_railwagon) >> 8;
uint num_vehicles = 1 + CountArticulatedParts(engine);
@@ -666,9 +666,9 @@
}
}
-static int32 EstimateTrainCost(const RailVehicleInfo* rvi)
+static int32 EstimateTrainCost(EngineID engine, const RailVehicleInfo* rvi)
{
- return rvi->base_cost * (_price.build_railvehicle >> 3) >> 5;
+ return GetEngineProperty(engine, 0x17, rvi->base_cost) * (_price.build_railvehicle >> 3) >> 5;
}
static void AddRearEngineToMultiheadedTrain(Vehicle* v, Vehicle* u, bool building)
@@ -728,7 +728,7 @@
if (rvi->railveh_type == RAILVEH_WAGON) return CmdBuildRailWagon(p1, tile, flags);
- int32 value = EstimateTrainCost(rvi);
+ int32 value = EstimateTrainCost(p1, rvi);
uint num_vehicles =
(rvi->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1) +