Refresh town cargo acceptance/production on load on NewGRFs mismatch

Also when reloading NewGRFs
This commit is contained in:
Jonathan G Rennison
2019-05-26 20:29:29 +01:00
parent bc5681e79f
commit e21c80ae45
3 changed files with 4 additions and 6 deletions

View File

@@ -1689,7 +1689,7 @@ bool AfterLoadGame()
} }
/* Check and update house and town values */ /* Check and update house and town values */
UpdateHousesAndTowns(); UpdateHousesAndTowns(gcf_res != GLC_ALL_GOOD);
if (IsSavegameVersionBefore(SLV_43)) { if (IsSavegameVersionBefore(SLV_43)) {
for (TileIndex t = 0; t < map_size; t++) { for (TileIndex t = 0; t < map_size; t++) {
@@ -3792,7 +3792,7 @@ void ReloadNewGRFData()
/* Update company statistics. */ /* Update company statistics. */
AfterLoadCompanyStats(); AfterLoadCompanyStats();
/* Check and update house and town values */ /* Check and update house and town values */
UpdateHousesAndTowns(); UpdateHousesAndTowns(true);
/* Delete news referring to no longer existing entities */ /* Delete news referring to no longer existing entities */
DeleteInvalidEngineNews(); DeleteInvalidEngineNews();
/* Update livery selection windows */ /* Update livery selection windows */

View File

@@ -36,7 +36,7 @@ void AfterLoadStoryBook();
void AfterLoadLinkGraphs(); void AfterLoadLinkGraphs();
void AfterLoadCompanyStats(); void AfterLoadCompanyStats();
void AfterLoadTraceRestrict(); void AfterLoadTraceRestrict();
void UpdateHousesAndTowns(); void UpdateHousesAndTowns(bool cargo_update_required);
void UpdateOldAircraft(); void UpdateOldAircraft();

View File

@@ -68,10 +68,8 @@ void RebuildTownCaches(bool cargo_update_required)
* town, the town radius and the max passengers * town, the town radius and the max passengers
* of the town. * of the town.
*/ */
void UpdateHousesAndTowns() void UpdateHousesAndTowns(bool cargo_update_required)
{ {
bool cargo_update_required = false;
for (TileIndex t = 0; t < MapSize(); t++) { for (TileIndex t = 0; t < MapSize(); t++) {
if (!IsTileType(t, MP_HOUSE)) continue; if (!IsTileType(t, MP_HOUSE)) continue;