From 370a4219420d546998662f6865fbd2b2013be271 Mon Sep 17 00:00:00 2001 From: dP Date: Thu, 20 Feb 2020 21:16:03 +0300 Subject: [PATCH] Always open vehicle window when ctrl-cloning (revert #6754) --- src/depot_gui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index e80ed6e3ae..d5c87b2fe2 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -884,6 +884,10 @@ struct DepotWindow : Window { */ bool OnVehicleSelect(const Vehicle *v) override { + if (DoCommandP(this->window_number, v->index, _ctrl_pressed ? 1 : 0, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), CcCloneVehicle)) + ResetObjectToPlace(); + + #if 0 // CM revert #6754 if (_ctrl_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ DoCommandP(this->window_number, v->index, 1, CMD_CLONE_VEHICLE | CMD_MSG(STR_ERROR_CAN_T_BUY_TRAIN + v->type), nullptr); @@ -893,6 +897,7 @@ struct DepotWindow : Window { ResetObjectToPlace(); } } + #endif return true; }