summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-12-22 10:28:58 +0000
committeralberth <alberth@openttd.org>2009-12-22 10:28:58 +0000
commitd47c6e413581467fac5864eedebeec1025edd572 (patch)
tree1fe35dfddac8eb97e9ad6e4ab9ff0d316baf4f66 /src
parentc816281e091abc6a46835df74572bf99fdf39798 (diff)
downloadopenttd-d47c6e413581467fac5864eedebeec1025edd572.tar.xz
(svn r18599) -Fix: Displaying selected orders of a competitor vehicle was broken, disable the selection.
Diffstat (limited to 'src')
-rw-r--r--src/order_gui.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 62a2113b6..bd5781212 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -491,6 +491,8 @@ private:
*/
int GetOrderFromPt(int y)
{
+ if (this->vehicle->owner != _local_company) return INVALID_ORDER; // Selection is not possible at orders of a competitor.
+
int sel = (y - this->GetWidget<NWidgetBase>(ORDER_WIDGET_ORDER_LIST)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height; // Selected line in the ORDER_WIDGET_ORDER_LIST panel.
if ((uint)sel >= this->vscroll.GetCapacity()) return INVALID_ORDER;
@@ -929,6 +931,7 @@ public:
virtual void OnPaint()
{
+ if (this->vehicle->owner != _local_company) this->selected_order = -1; // Disable selection any selected row at a competitor order window.
this->DrawWidgets();
}