diff options
author | maedhros <maedhros@openttd.org> | 2007-06-17 10:14:47 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-06-17 10:14:47 +0000 |
commit | cf4911ddaf0940887e9dcd62334169de6d5c26c2 (patch) | |
tree | 7946ba9987f7c8d2fb63925f2a6717aae1224e16 | |
parent | f177c1769f51e8e1c0885ef4f14a4bfc25f5a481 (diff) | |
download | openttd-cf4911ddaf0940887e9dcd62334169de6d5c26c2.tar.xz |
(svn r10176) -Fix (r10071): Deselect the currently selected order when clicking on an empty part of the orders window.
-rw-r--r-- | src/order_gui.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 3f1ab718e..116b67df1 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -554,7 +554,13 @@ static void OrdersWndProc(Window *w, WindowEvent *e) int sel = GetOrderFromOrderWndPt(w, e->we.click.pt.y, v); - if (sel == INVALID_ORDER) return; + if (sel == INVALID_ORDER) { + /* This was a click on an empty part of the orders window, so + * deselect the currently selected order. */ + WP(w,order_d).sel = -1; + SetWindowDirty(w); + return; + } if (_ctrl_pressed && sel < v->num_orders) { const Order *ord = GetVehicleOrder(v, sel); |