diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 7c58aa293a..e31114b457 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); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 8301fa86a1..afa4e31d36 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1553,7 +1553,6 @@ static const WindowDesc _vehicle_details_desc = { static void ShowVehicleDetailsWindow(const Vehicle *v) { DeleteWindowById(WC_VEHICLE_ORDERS, v->index); - DeleteWindowById(WC_VEHICLE_DETAILS, v->index); AllocateWindowDescFront(&_vehicle_details_desc, v->index); }