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

View File

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

View File

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