From fdf2d3dfe169aa1cade4acca90cf176a113ae8c9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 26 Sep 2022 21:54:14 +0100 Subject: [PATCH] Fix vehicles with no cargo being shown with last cargo in build window --- src/build_vehicle_gui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 50e40dd9ed..4eaa14b3b0 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1465,6 +1465,7 @@ struct BuildVehicleWindow : BuildVehicleWindowBase { if (!e->CanCarryCargo()) { this->te.cost = 0; this->te.cargo = CT_INVALID; + this->te.all_capacities.Clear(); return; } @@ -2248,6 +2249,7 @@ struct BuildVehicleWindowTrainAdvanced final : BuildVehicleWindowBase { if (!e->CanCarryCargo()) { state.te.cost = 0; state.te.cargo = CT_INVALID; + state.te.all_capacities.Clear(); return; }