(svn r10176) -Fix (r10071): Deselect the currently selected order when clicking on an empty part of the orders window.
authormaedhros
Sun, 17 Jun 2007 10:14:47 +0000
changeset 6923 a8f85a57a0ef
parent 6922 eb7cc89d826b
child 6924 f2ac2b1f5d06
(svn r10176) -Fix (r10071): Deselect the currently selected order when clicking on an empty part of the orders window.
src/order_gui.cpp
--- a/src/order_gui.cpp	Sun Jun 17 07:24:39 2007 +0000
+++ b/src/order_gui.cpp	Sun Jun 17 10:14:47 2007 +0000
@@ -554,7 +554,13 @@
 
 			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);