Fix industry cargoes when loading newer vanilla savegames

This commit is contained in:
Jonathan G Rennison
2024-04-17 17:35:01 +01:00
parent d70c824056
commit e17c6da46a

View File

@@ -64,6 +64,10 @@ public:
{
size_t len = SlGetStructListLength(INDUSTRY_NUM_INPUTS);
for (size_t j = 0; j < INDUSTRY_NUM_INPUTS; j++) {
i->accepts_cargo[j] = INVALID_CARGO;
}
for (size_t j = 0; j < len; j++) {
AcceptedCargo a = {};
SlObject(&a, this->GetDescription());
@@ -119,6 +123,17 @@ public:
{
size_t len = SlGetStructListLength(INDUSTRY_NUM_OUTPUTS);
for (size_t j = 0; j < INDUSTRY_NUM_OUTPUTS; j++) {
i->produced_cargo[j] = INVALID_CARGO;
i->produced_cargo_waiting[j] = 0;
i->production_rate[j] = 0;
i->this_month_production[j] = 0;
i->this_month_transported[j] = 0;
i->last_month_production[j] = 0;
i->last_month_transported[j] = 0;
i->last_month_pct_transported[j] = 0;
}
for (size_t j = 0; j < len; j++) {
ProducedCargo p = {};
SlObject(&p, this->GetDescription());