(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
authorbjarni
Wed, 27 Jul 2005 10:11:45 +0000
changeset 2206 4518d18a5f58
parent 2205 a5b0685478f8
child 2207 be1ef1e1fc58
(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
vehicle_gui.c
--- a/vehicle_gui.c	Wed Jul 27 07:19:28 2005 +0000
+++ b/vehicle_gui.c	Wed Jul 27 10:11:45 2005 +0000
@@ -900,16 +900,8 @@
 
 		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: {