From b5a2183214f388e723a8abf1caef68037bdfe2c8 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 10 Dec 2011 19:20:30 +0000 Subject: (svn r23484) -Fix [FS#4770]: in case you already have orders, ignore the vehicles when adding an extra order --- src/order_gui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/order_gui.cpp') diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 90e4f8a6f..513e7b0e2 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1466,7 +1466,7 @@ public: } } - virtual void OnVehicleSelect(const Vehicle *v) + virtual bool OnVehicleSelect(const Vehicle *v) { /* v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet. * We disallow copying orders of other vehicles if we already have at least one order entry @@ -1474,13 +1474,14 @@ public: * Obviously if you press CTRL on a non-empty orders vehicle you know what you are doing * TODO: give a warning message */ bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; - if (this->vehicle->GetNumOrders() != 0 && !share_order) return; + if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; if (DoCommandP(this->vehicle->tile, this->vehicle->index | (share_order ? CO_SHARE : CO_COPY) << 30, v->index, share_order ? CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_SHARE_ORDER_LIST) : CMD_CLONE_ORDER | CMD_MSG(STR_ERROR_CAN_T_COPY_ORDER_LIST))) { this->selected_order = -1; ResetObjectToPlace(); } + return true; } virtual void OnPlaceObjectAbort() -- cgit v1.2.3-54-g00ecf