(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

This commit is contained in:
planetmaker 2011-08-04 17:13:24 +00:00
parent 75b92328c2
commit d20b5eb915
1 changed files with 2 additions and 0 deletions

View File

@ -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);