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);
81 std::vector<NewGRFCache> grf_cache;
82 std::vector<VehicleCache> veh_cache;
83 std::vector<GroundVehicleCache> gro_cache;
84 std::vector<TrainCache> tra_cache;
87 if (v != v->First() || v->vehstatus.Test(
VehState::Crashed) || !v->IsPrimaryVehicle())
continue;
89 for (
const Vehicle *u = v; u !=
nullptr; u = u->
Next()) {
91 grf_cache.emplace_back(u->grf_cache);
92 veh_cache.emplace_back(u->vcache);
115 for (
const Vehicle *u = v; u !=
nullptr; u = u->
Next()) {
117 if (grf_cache[length] != u->grf_cache) {
118 Debug(desync, 2,
"warning: newgrf cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length);
120 if (veh_cache[length] != u->vcache) {
121 Debug(desync, 2,
"warning: vehicle cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length);
126 Debug(desync, 2,
"warning: train ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
129 Debug(desync, 2,
"warning: train cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
134 Debug(desync, 2,
"warning: road vehicle ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length);
151 [[maybe_unused]]
const auto a = v->cargo.PeriodsInTransit();
152 [[maybe_unused]]
const auto b = v->cargo.TotalCount();
153 [[maybe_unused]]
const auto c = v->cargo.GetFeederShare();
154 v->cargo.InvalidateCache();
155 assert(a == v->cargo.PeriodsInTransit());
156 assert(b == v->cargo.TotalCount());
157 assert(c == v->cargo.GetFeederShare());
161 std::vector<StationList> old_town_stations_near;
162 for (
Town *t :
Town::Iterate()) old_town_stations_near.push_back(t->stations_near);
164 std::vector<StationList> old_industry_stations_near;
167 std::vector<IndustryList> old_station_industries_near;
172 if (!ge.HasData())
continue;
176 [[maybe_unused]]
const auto b = cargo_list.
TotalCount();
184 std::map<TileIndex, bool> docking_tiles;
185 for (
TileIndex tile : st->docking_station) {
189 UpdateStationDockingTiles(st);
190 if (ta.
tile != st->docking_station.tile || ta.
w != st->docking_station.w || ta.
h != st->docking_station.h) {
191 Debug(desync, 2,
"warning: station docking mismatch: station {}, company {}", st->index, st->owner);
195 Debug(desync, 2,
"warning: docking tile mismatch: tile {}", tile);
205 if (st->industries_near != old_station_industries_near[i]) {
206 Debug(desync, 2,
"warning: station industries near mismatch: station {}", st->index);
214 if (t->stations_near != old_town_stations_near[i]) {
215 Debug(desync, 2,
"warning: town stations near mismatch: town {}", t->index);
221 if (ind->stations_near != old_industry_stations_near[i]) {
222 Debug(desync, 2,
"warning: industry stations near mismatch: industry {}", ind->index);
Stores station stats for a single cargo.