diff options
author | tron <tron@openttd.org> | 2005-10-07 07:35:15 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-07 07:35:15 +0000 |
commit | 3397e202c82cda0398ef4a642e74f2d864c5dc7d (patch) | |
tree | 75058b5a9db24d07229edde45f993401aec6bd63 /train_gui.c | |
parent | 2b44da199c7bb6aae62a7e6aaae7775a07d16bdd (diff) | |
download | openttd-3397e202c82cda0398ef4a642e74f2d864c5dc7d.tar.xz |
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/train_gui.c b/train_gui.c index fe64fcccc..67968945a 100644 --- a/train_gui.c +++ b/train_gui.c @@ -173,7 +173,7 @@ void CcCloneTrain(bool success, uint tile, uint32 p1, uint32 p2) } static void engine_drawing_loop(int *x, int *y, int *pos, int *sel, - int *selected_id, byte railtype, byte show_max, bool is_engine) + EngineID* selected_id, byte railtype, byte show_max, bool is_engine) { EngineID i; @@ -229,7 +229,7 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e) int pos = w->vscroll.pos; int x = 1; int y = 15; - int selected_id = -1; + EngineID selected_id = INVALID_ENGINE; /* Ensure that custom engines which substituted wagons * are sorted correctly. @@ -241,7 +241,7 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e) WP(w,buildtrain_d).sel_engine = selected_id; - if (selected_id != -1) { + if (selected_id != INVALID_ENGINE) { const RailVehicleInfo *rvi = RailVehInfo(selected_id); if (!(rvi->flags & RVI_WAGON)) { @@ -265,14 +265,13 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e) } } break; case 5: { - int sel_eng; - sel_eng = WP(w,buildtrain_d).sel_engine; - if (sel_eng != -1) + EngineID sel_eng = WP(w,buildtrain_d).sel_engine; + if (sel_eng != INVALID_ENGINE) DoCommandP(w->window_number, sel_eng, 0, (RailVehInfo(sel_eng)->flags & RVI_WAGON) ? CcBuildWagon : CcBuildLoco, CMD_BUILD_RAIL_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE)); } break; case 6: { /* rename */ - int sel_eng = WP(w,buildtrain_d).sel_engine; - if (sel_eng != -1) { + EngineID sel_eng = WP(w,buildtrain_d).sel_engine; + if (sel_eng != INVALID_ENGINE) { WP(w,buildtrain_d).rename_engine = sel_eng; ShowQueryString(GetCustomEngineName(sel_eng), STR_886A_RENAME_TRAIN_VEHICLE_TYPE, 31, 160, w->window_class, w->window_number); |