summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 7c58aa293..e31114b45 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -1267,10 +1267,8 @@ static const WindowDesc _other_orders_desc = {
void ShowOrdersWindow(const Vehicle *v)
{
- VehicleID veh = v->index;
-
- DeleteWindowById(WC_VEHICLE_ORDERS, veh);
- DeleteWindowById(WC_VEHICLE_DETAILS, veh);
+ DeleteWindowById(WC_VEHICLE_DETAILS, v->index);
+ if (BringWindowToFrontById(WC_VEHICLE_ORDERS, v->index) != NULL) return;
if (v->owner != _local_company) {
new OrdersWindow(&_other_orders_desc, v);