summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-13 12:49:51 +0000
committersmatz <smatz@openttd.org>2009-08-13 12:49:51 +0000
commitbd6acb36aed5ef4f65a9d6fea1388cfad9cba3b3 (patch)
tree77b8cff66c6754530c80bc2412871e4098f80cec
parente74ca21912f7043a05101ed90a92ec500019595e (diff)
downloadopenttd-bd6acb36aed5ef4f65a9d6fea1388cfad9cba3b3.tar.xz
(svn r17164) -Fix: crash when clicking on the spacer in the build airport GUI
-rw-r--r--src/airport_gui.cpp6
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);
}