diff options
author | bjarni <bjarni@openttd.org> | 2005-07-27 10:11:45 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2005-07-27 10:11:45 +0000 |
commit | 6f74bbaeec503b01a317d9e6f52cb545f6835c3a (patch) | |
tree | d3faba24aa2c919358144b046dacfd844df9d134 /vehicle_gui.c | |
parent | 249a35cfe838bd184fdf0bb30839aec918f185a3 (diff) | |
download | openttd-6f74bbaeec503b01a317d9e6f52cb545f6835c3a.tar.xz |
(svn r2724) -Fix: [Autoreplace] made the pulldown menu read GetPlayer(_local_player)->avail_railtypes - this removes the need for updating this code if we add more railtypes and it also allows the menu to show maglev when monorail is not available
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r-- | vehicle_gui.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c index 8b176fccf..2ca8b54ed 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -900,16 +900,8 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e) case WE_CLICK: { switch(e->click.widget) { - case 14: case 15:/* Select sorting criteria dropdown menu */ - // finds mask for available engines - { - int engine_avail = 0; - if (!HASBIT(GetEngine(NUM_NORMAL_RAIL_ENGINES + NUM_MONORAIL_ENGINES)->player_avail, _local_player)) { - engine_avail = 4; - if (!HASBIT(GetEngine(NUM_NORMAL_RAIL_ENGINES)->player_avail, _local_player)) - engine_avail = 6; - } - ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, engine_avail, 1); + case 14: case 15: { /* Select sorting criteria dropdown menu */ + ShowDropDownMenu(w, _rail_types_list, _railtype_selected_in_replace_gui, 15, ~GetPlayer(_local_player)->avail_railtypes, 1); break; } case 4: { |