summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-08-29 00:17:47 +0000
committerbelugas <belugas@openttd.org>2006-08-29 00:17:47 +0000
commit5771cd10f98c7802f598bbcbf0a0c5d0be667c84 (patch)
tree19545c9bc20aa9c6d5198cd44ea6008c9d095df5 /ship_gui.c
parent27cee58ab823cbab0ab8905ce7b52143de7ca5e5 (diff)
downloadopenttd-5771cd10f98c7802f598bbcbf0a0c5d0be667c84.tar.xz
(svn r6205) -CodeChange : use a switch case instead of a cascade of if
-CodeChange : rename var Engine *e to Engine *eng, since we have WindowEvent *e in same fnct -CodeChange : fix a broken tabulation on a switch case. SOme breathing spaces too
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ship_gui.c b/ship_gui.c
index 9647d972b..e57174b1b 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -328,11 +328,11 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
{
int count = 0;
int num = NUM_SHIP_ENGINES;
- const Engine *e = GetEngine(SHIP_ENGINES_INDEX);
+ const Engine *eng = GetEngine(SHIP_ENGINES_INDEX);
do {
- if (HASBIT(e->player_avail, _local_player)) count++;
- } while (++e,--num);
+ if (HASBIT(eng->player_avail, _local_player)) count++;
+ } while (++eng,--num);
SetVScrollCount(w, count);
}
@@ -340,7 +340,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
{
int num = NUM_SHIP_ENGINES;
- const Engine *e = GetEngine(SHIP_ENGINES_INDEX);
+ const Engine *eng = GetEngine(SHIP_ENGINES_INDEX);
int x = 2;
int y = 15;
int sel = WP(w,buildtrain_d).sel_index;
@@ -349,7 +349,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
EngineID selected_id = INVALID_ENGINE;
do {
- if (HASBIT(e->player_avail, _local_player)) {
+ if (HASBIT(eng->player_avail, _local_player)) {
if (sel==0) selected_id = engine_id;
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
@@ -358,7 +358,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
}
sel--;
}
- } while (++engine_id, ++e,--num);
+ } while (++engine_id, ++eng,--num);
WP(w,buildtrain_d).sel_engine = selected_id;