diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/airport_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 0c9da8732..7bc71ea40 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -90,9 +90,9 @@ struct BuildAirToolbarWindow : Window { virtual void OnClick(Point pt, int widget) { - if (widget - ATW_AIRPORT >= 0) { - _build_air_button_proc[widget - ATW_AIRPORT](this); - } + if (!IsInsideBS(widget, ATW_AIRPORT, lengthof(_build_air_button_proc))) return; + + _build_air_button_proc[widget - ATW_AIRPORT](this); } |