From d20b5eb91584cc251e45e49f3426cbe54eaf4ca7 Mon Sep 17 00:00:00 2001 From: planetmaker Date: Thu, 4 Aug 2011 17:13:24 +0000 Subject: [PATCH] (svn r22715) -Fix: If there's also no point in opening the air toolbar via custom-defined global hotkeys, if there are no aircraft available --- src/airport_gui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index f739bed625..a4a27a057b 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -26,6 +26,7 @@ #include "widgets/dropdown_type.h" #include "core/geometry_func.hpp" #include "hotkeys.h" +#include "vehicle_func.h" #include "sprite.h" #include "table/strings.h" @@ -107,6 +108,7 @@ struct BuildAirToolbarWindow : Window { virtual EventState OnKeyPress(uint16 key, uint16 keycode) { + if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED; int num = CheckHotkeyMatch(airtoolbar_hotkeys, keycode, this); if (num == -1) return ES_NOT_HANDLED; this->OnClick(Point(), num, 1);