Fix vehicles with no cargo being shown with last cargo in build window

This commit is contained in:
Jonathan G Rennison
2022-09-26 21:54:14 +01:00
parent e39962871f
commit fdf2d3dfe1

View File

@@ -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;
}