From e0e380e8d9fdb016769c5f044ea048ac87a6ca11 Mon Sep 17 00:00:00 2001 From: maedhros Date: Sun, 17 Jun 2007 10:14:47 +0000 Subject: (svn r10176) -Fix (r10071): Deselect the currently selected order when clicking on an empty part of the orders window. --- src/order_gui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2