1
0
Fork 0

Fix 3de8853e29: Industries accept/produce no cargo for pre-SLV_78 saves.

Industry accepted/produced was trimmed too early for original and pre-SLV_78 saves, as cargo type was not stored per slot so all slots look invalid to the trim function.
pull/12508/head
Peter Nelson 2024-04-17 12:43:55 +01:00
parent 6ee31a2a22
commit ef25457217
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
3 changed files with 8 additions and 2 deletions

View File

@ -1722,6 +1722,14 @@ bool AfterLoadGame()
}
}
/* Industry cargo slots were fixed size before (and including) SLV_VEHICLE_ECONOMY_AGE (either 2/3 or 16/16),
* after this they are dynamic. Trim excess slots. */
if (IsSavegameVersionBeforeOrAt(SLV_VEHICLE_ECONOMY_AGE)) {
for (Industry *i : Industry::Iterate()) {
TrimIndustryAcceptedProduced(i);
}
}
/* Before version 81, the density of grass was always stored as zero, and
* grassy trees were always drawn fully grassy. Furthermore, trees on rough
* land used to have zero density, now they have full density. Therefore,

View File

@ -266,7 +266,6 @@ struct INDYChunkHandler : ChunkHandler {
LoadMoveAcceptsProduced(i, INDUSTRY_NUM_INPUTS, INDUSTRY_NUM_OUTPUTS);
}
Industry::IncIndustryTypeCount(i->type);
TrimIndustryAcceptedProduced(i);
}
}

View File

@ -875,7 +875,6 @@ static bool LoadOldIndustry(LoadgameState *ls, int num)
}
Industry::IncIndustryTypeCount(i->type);
TrimIndustryAcceptedProduced(i);
} else {
delete i;
}