(svn r23405) -Codechange: Keep a matrix of cargos accepted by houses for each town (michi_cc).

This commit is contained in:
terkhen
2011-12-03 22:21:27 +00:00
parent e9e62b1629
commit 59d8b0204f
4 changed files with 133 additions and 0 deletions

View File

@@ -2700,6 +2700,19 @@ bool AfterLoadGame()
* which is done by StartupEngines(). */
if (gcf_res != GLC_ALL_GOOD) StartupEngines();
if (IsSavegameVersionBefore(166)) {
/* Update cargo acceptance map of towns. */
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) {
UpdateTownCargos(town);
}
}
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();