diff options
author | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-23 13:04:44 +0000 |
commit | 47137cefb72d3b3d3bc6fdefc7a4b103429f6d46 (patch) | |
tree | 7a8d1fbbe0d0d6ee2c8e981c57be6a9003505e97 /engine_gui.c | |
parent | 2cc2154ad26b96b032df2f4fca0ce1634e6330b2 (diff) | |
download | openttd-47137cefb72d3b3d3bc6fdefc7a4b103429f6d46.tar.xz |
(svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
Diffstat (limited to 'engine_gui.c')
-rw-r--r-- | engine_gui.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engine_gui.c b/engine_gui.c index 54d0395f7..eb4c35d41 100644 --- a/engine_gui.c +++ b/engine_gui.c @@ -122,7 +122,6 @@ void ShowEnginePreviewWindow(EngineID engine) static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw) { const RailVehicleInfo *rvi = RailVehInfo(engine); - int cap; uint multihead = (rvi->flags & RVI_MULTIHEAD) ? 1 : 0; SetDParam(0, (_price.build_railvehicle >> 3) * rvi->base_cost >> 5); @@ -132,11 +131,11 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw) SetDParam(4, rvi->running_cost_base * _price.running_rail[rvi->engclass] >> 8 << multihead); - cap = rvi->capacity; - SetDParam(5, STR_8838_N_A); - if (cap != 0) { - SetDParam(6, cap << multihead); + if (rvi->capacity != 0) { SetDParam(5, _cargoc.names_long[rvi->cargo_type]); + SetDParam(6, rvi->capacity << multihead); + } else { + SetDParam(5, STR_8838_N_A); } DrawStringMultiCenter(x, y, STR_885B_COST_WEIGHT_T_SPEED_POWER, maxw); } |