(svn r5595) Show all aircraft in the dry-run build window of the global aircraft list again
authortron
Sat, 22 Jul 2006 16:44:55 +0000
changeset 4162 55a57b73a408
parent 4161 60e38778d90b
child 4163 165adce07f8c
(svn r5595) Show all aircraft in the dry-run build window of the global aircraft list again
aircraft_gui.c
--- a/aircraft_gui.c	Sat Jul 22 14:43:53 2006 +0000
+++ b/aircraft_gui.c	Sat Jul 22 16:44:55 2006 +0000
@@ -113,11 +113,14 @@
 	switch (e->event) {
 	case WE_PAINT: {
 		TileIndex tile = w->window_number;
-		const AirportFTAClass* ap;
+		byte acc_planes;
 
-		if (tile == 0) SETBIT(w->disabled_state, 5);
-
-		ap = GetAirport(GetStationByTile(tile)->airport_type);
+		if (tile == 0) {
+			SETBIT(w->disabled_state, 5);
+			acc_planes = ALL;
+		} else {
+			acc_planes = GetAirport(GetStationByTile(tile)->airport_type)->acc_planes;
+		}
 
 		{
 			int count = 0;
@@ -129,7 +132,7 @@
 				if (!HASBIT(GetEngine(eid)->player_avail, _local_player)) continue;
 
 				avi = AircraftVehInfo(eid);
-				if ((avi->subtype & AIR_CTOL ? HELICOPTERS_ONLY : AIRCRAFT_ONLY) == ap->acc_planes) continue;
+				if ((avi->subtype & AIR_CTOL ? HELICOPTERS_ONLY : AIRCRAFT_ONLY) == acc_planes) continue;
 
 				count++;
 			}
@@ -152,7 +155,7 @@
 				if (!HASBIT(GetEngine(eid)->player_avail, _local_player)) continue;
 
 				avi = AircraftVehInfo(eid);
-				if ((avi->subtype & AIR_CTOL ? HELICOPTERS_ONLY : AIRCRAFT_ONLY) == ap->acc_planes) continue;
+				if ((avi->subtype & AIR_CTOL ? HELICOPTERS_ONLY : AIRCRAFT_ONLY) == acc_planes) continue;
 
 				if (sel == 0) selected_id = eid;