diff --git a/src/openttd.cpp b/src/openttd.cpp index efd92d71d7..1c7e0a663e 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1163,10 +1163,12 @@ void CheckCaches(bool force_check, std::function log) /* Check the town caches. */ std::vector old_town_caches; std::vector old_town_cargo_accepted_totals; + std::vector old_town_cargo_produced; std::vector old_town_stations_near; for (const Town *t : Town::Iterate()) { old_town_caches.push_back(t->cache); old_town_cargo_accepted_totals.push_back(t->cargo_accepted_total); + old_town_cargo_produced.push_back(t->cargo_produced); old_town_stations_near.push_back(t->stations_near); } @@ -1182,6 +1184,8 @@ void CheckCaches(bool force_check, std::function log) old_industry_stations_near.push_back(ind->stations_near); } + const CargoTypes old_town_cargoes_accepted = _town_cargoes_accepted; + extern void RebuildTownCaches(); RebuildTownCaches(); RebuildSubsidisedSourceAndDestinationCache(); @@ -1392,7 +1396,10 @@ void CheckCaches(bool force_check, std::function log) CCLOG("town stations near mismatch: town %i", t->index); } if (old_town_cargo_accepted_totals[i] != t->cargo_accepted_total) { - CCLOG("town cargo_accepted_total mismatch: town %i", (int)t->index); + CCLOG("town cargo_accepted_total mismatch: town %i, old: " OTTD_PRINTFHEX64 ". new: " OTTD_PRINTFHEX64, (int)t->index, old_town_cargo_accepted_totals[i], t->cargo_accepted_total); + } + if (old_town_cargo_produced[i] != t->cargo_produced) { + CCLOG("town cargo_produced mismatch: town %i, old: " OTTD_PRINTFHEX64 ". new: " OTTD_PRINTFHEX64, (int)t->index, old_town_cargo_produced[i], t->cargo_produced); } if (old_town_stations_near[i] != t->stations_near) { CCLOG("town stations_near mismatch: town %i", (int)t->index); @@ -1407,6 +1414,10 @@ void CheckCaches(bool force_check, std::function log) i++; } + if (old_town_cargoes_accepted != _town_cargoes_accepted) { + CCLOG("_town_cargoes_accepted mismatch: old: " OTTD_PRINTFHEX64 ". new: " OTTD_PRINTFHEX64, old_town_cargoes_accepted, _town_cargoes_accepted); + } + #undef CCLOG }