Fix town production and acceptance cache saveload/update handling

This commit is contained in:
Jonathan G Rennison
2019-05-26 13:35:33 +01:00
parent 33344482ae
commit c2470a21af
8 changed files with 68 additions and 26 deletions

View File

@@ -3093,17 +3093,21 @@ bool AfterLoadGame()
* which is done by StartupEngines(). */
if (gcf_res != GLC_ALL_GOOD) StartupEngines();
if (IsSavegameVersionBefore(SLV_166)) {
if (SlXvIsFeatureMissing(XSLFI_TOWN_CARGO_MATRIX)) {
/* Update cargo acceptance map of towns. */
Town *town;
FOR_ALL_TOWNS(town) {
town->cargo_accepted.Clear();
}
for (TileIndex t = 0; t < map_size; t++) {
if (!IsTileType(t, MP_HOUSE)) continue;
Town::Get(GetTownIndex(t))->cargo_accepted.Add(t);
}
Town *town;
FOR_ALL_TOWNS(town) {
UpdateTownCargoes(town);
}
UpdateTownCargoBitmap();
}
/* Set some breakdown-related variables to the correct values. */