summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-10 19:20:30 +0000
committerrubidium <rubidium@openttd.org>2011-12-10 19:20:30 +0000
commitb5a2183214f388e723a8abf1caef68037bdfe2c8 (patch)
treead101cda87941bbe95e541a330e1ebc851a94feb /src/order_gui.cpp
parentd800fcae1da18bb0df1c3c1a28314b339b02ba99 (diff)
downloadopenttd-b5a2183214f388e723a8abf1caef68037bdfe2c8.tar.xz
(svn r23484) -Fix [FS#4770]: in case you already have orders, ignore the vehicles when adding an extra order
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp5
1 files changed, 3 insertions, 2 deletions
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()