summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-02-17 12:45:15 +0000
committerbjarni <bjarni@openttd.org>2007-02-17 12:45:15 +0000
commit6bbe135446e0450076670c20a495ea00025ca9dc (patch)
treec05f01c9f94a251c06c12e5cc26c795988cd5154 /src/build_vehicle_gui.cpp
parenta66176c89414b14adbfbb47631360a6186e41174 (diff)
downloadopenttd-6bbe135446e0450076670c20a495ea00025ca9dc.tar.xz
(svn r8771) -Fix r8343: build aircraft windows will no longer show aircraft that can't use the airport in question
Now it's even better than ever because unless the no jetcrash cheat is enabled, the small airports will not show fast aircraft
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 99925fbd7..c695108a9 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -692,6 +692,24 @@ static void GenerateBuildAircraftList(Window *w)
sel_id = INVALID_ENGINE;
for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
if (IsEngineBuildable(eid, VEH_Aircraft, _local_player)) {
+ const AircraftVehicleInfo *avi = AircraftVehInfo(eid);
+ switch (bv->filter.flags & ~AirportFTAClass::SHORT_STRIP /* we don't care about the length of the runway here */) {
+ case AirportFTAClass::HELICOPTERS:
+ if (avi->subtype != AIR_HELICOPTER) continue;
+ break;
+
+ case AirportFTAClass::AIRPLANES:
+ if (avi->subtype != AIR_AIRCRAFT) continue;
+ break;
+
+ case AirportFTAClass::ALL: break;
+ default:
+ NOT_REACHED();
+ }
+
+ if (bv->filter.flags & AirportFTAClass::SHORT_STRIP &&
+ avi->subtype & AIR_FAST && !_cheats.no_jetcrash.value) continue; // don't build large aircraft in small airports
+
EngList_Add(&bv->eng_list, eid);
if (eid == bv->sel_engine) sel_id = eid;