diff options
author | peter1138 <peter1138@openttd.org> | 2008-02-20 20:56:54 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-02-20 20:56:54 +0000 |
commit | 0e997be11ea96de172a372a5285dbd9a1f5174b0 (patch) | |
tree | 3c40c82307fa0b48d130d6a239cca2eedcd874ba /src/build_vehicle_gui.cpp | |
parent | e0b0ecc5a7781266e32ae6ee888d82a996635440 (diff) | |
download | openttd-0e997be11ea96de172a372a5285dbd9a1f5174b0.tar.xz |
(svn r12205) -Codechange: rename RailVehicleInfo::running_cost_base to running_cost, inline with other vehicle types (It is the factor, not the base)
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index b58aa3ba3..f369ad23d 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -230,8 +230,8 @@ static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b) const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a); const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b); - Money va = rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class] * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1); - Money vb = rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class] * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1); + Money va = rvi_a->running_cost * _price.running_rail[rvi_a->running_cost_class] * (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1); + Money vb = rvi_b->running_cost * _price.running_rail[rvi_b->running_cost_class] * (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 2 : 1); int r = ClampToI32(va - vb); return _internal_sort_order ? -r : r; @@ -248,8 +248,8 @@ static int CDECL TrainEnginePowerVsRunningCostSorter(const void *a, const void * * Because of this, the return value have to be reversed as well and we return b - a instead of a - b. * Another thing is that both power and running costs should be doubled for multiheaded engines. * Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */ - Money va = (rvi_a->running_cost_base * _price.running_rail[rvi_a->running_cost_class]) / max(1U, (uint)rvi_a->power); - Money vb = (rvi_b->running_cost_base * _price.running_rail[rvi_b->running_cost_class]) / max(1U, (uint)rvi_b->power); + Money va = (rvi_a->running_cost * _price.running_rail[rvi_a->running_cost_class]) / max(1U, (uint)rvi_a->power); + Money vb = (rvi_b->running_cost * _price.running_rail[rvi_b->running_cost_class]) / max(1U, (uint)rvi_b->power); int r = ClampToI32(vb - va); return _internal_sort_order ? -r : r; @@ -603,7 +603,7 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons } /* Running cost */ - SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost_base) * _price.running_rail[rvi->running_cost_class] >> 8) << multihead); + SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * _price.running_rail[rvi->running_cost_class] >> 8) << multihead); DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING); y += 10; |