diff options
author | smatz <smatz@openttd.org> | 2009-08-13 12:49:51 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-08-13 12:49:51 +0000 |
commit | bd6acb36aed5ef4f65a9d6fea1388cfad9cba3b3 (patch) | |
tree | 77b8cff66c6754530c80bc2412871e4098f80cec /src | |
parent | e74ca21912f7043a05101ed90a92ec500019595e (diff) | |
download | openttd-bd6acb36aed5ef4f65a9d6fea1388cfad9cba3b3.tar.xz |
(svn r17164) -Fix: crash when clicking on the spacer in the build airport GUI
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); } |