From 89aeb973f8330b707762db0278a96b498cfff780 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 15 Feb 2016 19:29:00 +0000 Subject: [PATCH] TBTR: Fix create window not being redrawn when selling vehs in MP. --- src/tbtr_template_gui_create.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tbtr_template_gui_create.cpp b/src/tbtr_template_gui_create.cpp index 01b4e28848..1b858c8e1c 100644 --- a/src/tbtr_template_gui_create.cpp +++ b/src/tbtr_template_gui_create.cpp @@ -365,7 +365,7 @@ public: virtual_train = (_ctrl_pressed) ? NULL : virtual_train->GetNextUnit(); } - DoCommandP(0, this->sel | (sell_cmd << 20) | (1 << 21), 0, GetCmdSellVeh(VEH_TRAIN)); + DoCommandP(0, this->sel | (sell_cmd << 20) | (1 << 21), 0, GetCmdSellVeh(VEH_TRAIN), CcDeleteVirtualTrain); this->sel = INVALID_VEHICLE; @@ -570,6 +570,10 @@ void CcVirtualTrainWaggonsMoved(const CommandCost &result, TileIndex tile, uint3 void CcDeleteVirtualTrain(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { - VehicleID virtual_train_id = p2; - DoCommandP(0, virtual_train_id, 0, CMD_DELETE_VIRTUAL_TRAIN); + if (result.Failed()) return; + + Window* window = FindWindowById(WC_CREATE_TEMPLATE, 0); + if (window) { + window->InvalidateData(); + } }