diff options
author | rubidium <rubidium@openttd.org> | 2009-02-19 09:45:44 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-19 09:45:44 +0000 |
commit | 02c52430c88db61e4004cf94a99449cd464cbd55 (patch) | |
tree | c9ee92ae7cbfe93892ebfded0c1f663c6a2f9e99 /src/build_vehicle_gui.cpp | |
parent | 9a507acf377cc14ff7bf0ab50b34b23aed98d218 (diff) | |
download | openttd-02c52430c88db61e4004cf94a99449cd464cbd55.tar.xz |
(svn r15521) -Codechange: add helper function to get the display tractive effort of a vehicle.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 9164d95b4..feb01a051 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -512,11 +512,10 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, const RailVehicleInfo *rvi) { const Engine *e = GetEngine(engine_number); - uint weight = e->GetDisplayWeight(); /* Purchase Cost - Engine weight */ SetDParam(0, e->GetCost()); - SetDParam(1, weight); + SetDParam(1, e->GetDisplayWeight()); DrawString(x, y, STR_PURCHASE_INFO_COST_WEIGHT, TC_FROMSTRING); y += 10; @@ -528,7 +527,7 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons /* Max tractive effort - not applicable if old acceleration or maglev */ if (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && rvi->railtype != RAILTYPE_MAGLEV) { - SetDParam(0, (weight * 10 * GetEngineProperty(engine_number, 0x1F, rvi->tractive_effort)) / 256); + SetDParam(0, e->GetDisplayMaxTractiveEffort()); DrawString(x, y, STR_PURCHASE_INFO_MAX_TE, TC_FROMSTRING); y += 10; } |