changeset 17911:bffca9b7ed7f draft

(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
author planetmaker <planetmaker@openttd.org>
date Thu, 04 Aug 2011 17:13:24 +0000
parents 71fa31ee7ee9
children b92847541c85
files src/airport_gui.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 
 	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);