summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-08-04 17:13:24 +0000
committerplanetmaker <planetmaker@openttd.org>2011-08-04 17:13:24 +0000
commitd20b5eb91584cc251e45e49f3426cbe54eaf4ca7 (patch)
tree465bfa4b5a504ce5cd884be4fae66014d38a2532 /src
parent75b92328c224477d9690226bf2eab45c041be095 (diff)
downloadopenttd-d20b5eb91584cc251e45e49f3426cbe54eaf4ca7.tar.xz
(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
Diffstat (limited to 'src')
-rw-r--r--src/airport_gui.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index f739bed62..a4a27a057 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);