40 if (_debug_desync_level <= 1)
return;
43 std::vector<TownCache> old_town_caches;
45 old_town_caches.push_back(t->cache);
53 if (old_town_caches[i] != t->cache) {
54 Debug(desync, 2,
"warning: town cache mismatch: town {}", t->index);
60 std::vector<CompanyInfrastructure> old_infrastructure;
67 if (old_infrastructure[i] != c->infrastructure) {
68 Debug(desync, 2,
"warning: infrastructure cache mismatch: company {}", c->index);
82 std::vector<NewGRFCache> grf_cache;
83 std::vector<VehicleCache> veh_cache;
84 std::vector<GroundVehicleCache> gro_cache;
85 std::vector<TrainCache> tra_cache;
88 if (v != v->First() || v->vehstatus &
VS_CRASHED || !v->IsPrimaryVehicle())
continue;
90 for (
const Vehicle *u = v; u !=
nullptr; u = u->
Next()) {
92 grf_cache.emplace_back(u->grf_cache);
93 veh_cache.emplace_back(u->vcache);
116 for (
const Vehicle *u = v; u !=
nullptr; u = u->
Next()) {
118 if (grf_cache[length] != u->grf_cache) {
119 Debug(desync, 2,
"warning: newgrf cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length);
121 if (veh_cache[length] != u->vcache) {
122 Debug(desync, 2,
"warning: vehicle cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length);
127 Debug(desync, 2,
"warning: train ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
130 Debug(desync, 2,
"warning: train cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
135 Debug(desync, 2,
"warning: road vehicle ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
152 [[maybe_unused]]
const auto a = v->cargo.PeriodsInTransit();
153 [[maybe_unused]]
const auto b = v->cargo.TotalCount();
154 [[maybe_unused]]
const auto c = v->cargo.GetFeederShare();
155 v->cargo.InvalidateCache();
156 assert(a == v->cargo.PeriodsInTransit());
157 assert(b == v->cargo.TotalCount());
158 assert(c == v->cargo.GetFeederShare());
162 std::vector<StationList> old_town_stations_near;
163 for (
Town *t :
Town::Iterate()) old_town_stations_near.push_back(t->stations_near);
165 std::vector<StationList> old_industry_stations_near;
168 std::vector<IndustryList> old_station_industries_near;
173 [[maybe_unused]]
const auto a = ge.cargo.PeriodsInTransit();
174 [[maybe_unused]]
const auto b = ge.cargo.TotalCount();
175 ge.cargo.InvalidateCache();
176 assert(a == ge.cargo.PeriodsInTransit());
177 assert(b == ge.cargo.TotalCount());
182 std::map<TileIndex, bool> docking_tiles;
183 for (
TileIndex tile : st->docking_station) {
187 UpdateStationDockingTiles(st);
188 if (ta.
tile != st->docking_station.tile || ta.
w != st->docking_station.w || ta.
h != st->docking_station.h) {
189 Debug(desync, 2,
"warning: station docking mismatch: station {}, company {}", st->index, st->owner);
193 Debug(desync, 2,
"warning: docking tile mismatch: tile {}", tile);
203 if (st->industries_near != old_station_industries_near[i]) {
204 Debug(desync, 2,
"warning: station industries near mismatch: station {}", st->index);
212 if (t->stations_near != old_town_stations_near[i]) {
213 Debug(desync, 2,
"warning: town stations near mismatch: town {}", t->index);
219 if (ind->stations_near != old_industry_stations_near[i]) {
220 Debug(desync, 2,
"warning: industry stations near mismatch: industry {}", ind->index);
Stores station stats for a single cargo.