Update to 1.10.0-beta2

This commit is contained in:
dP
2020-01-06 18:49:34 +03:00
parent 599ccf0c2b
commit c7c3966eec
1366 changed files with 2926 additions and 5639 deletions

View File

@@ -1,5 +1,3 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -1190,8 +1188,7 @@ static void CheckCaches()
/* Check the town caches. */
std::vector<TownCache> old_town_caches;
Town *t;
FOR_ALL_TOWNS(t) {
for (const Town *t : Town::Iterate()) {
old_town_caches.push_back(t->cache);
}
@@ -1200,7 +1197,7 @@ static void CheckCaches()
RebuildSubsidisedSourceAndDestinationCache();
uint i = 0;
FOR_ALL_TOWNS(t) {
for (Town *t : Town::Iterate()) {
if (MemCmpT(old_town_caches.data() + i, &t->cache) != 0) {
DEBUG(desync, 2, "town cache mismatch: town %i", (int)t->index);
}
@@ -1209,14 +1206,13 @@ static void CheckCaches()
/* Check company infrastructure cache. */
std::vector<CompanyInfrastructure> old_infrastructure;
Company *c;
FOR_ALL_COMPANIES(c) old_infrastructure.push_back(c->infrastructure);
for (const Company *c : Company::Iterate()) old_infrastructure.push_back(c->infrastructure);
extern void AfterLoadCompanyStats();
AfterLoadCompanyStats();
i = 0;
FOR_ALL_COMPANIES(c) {
for (const Company *c : Company::Iterate()) {
if (MemCmpT(old_infrastructure.data() + i, &c->infrastructure) != 0) {
DEBUG(desync, 2, "infrastructure cache mismatch: company %i", (int)c->index);
}
@@ -1224,8 +1220,7 @@ static void CheckCaches()
}
/* Strict checking of the road stop cache entries */
const RoadStop *rs;
FOR_ALL_ROADSTOPS(rs) {
for (const RoadStop *rs : RoadStop::Iterate()) {
if (IsStandardRoadStopTile(rs->xy)) continue;
assert(rs->GetEntry(DIAGDIR_NE) != rs->GetEntry(DIAGDIR_NW));
@@ -1233,8 +1228,7 @@ static void CheckCaches()
rs->GetEntry(DIAGDIR_NW)->CheckIntegrity(rs);
}
Vehicle *v;
FOR_ALL_VEHICLES(v) {
for (Vehicle *v : Vehicle::Iterate()) {
extern void FillNewGRFVehicleCache(const Vehicle *v);
if (v != v->First() || v->vehstatus & VS_CRASHED || !v->IsPrimaryVehicle()) continue;
@@ -1309,15 +1303,14 @@ static void CheckCaches()
}
/* Check whether the caches are still valid */
FOR_ALL_VEHICLES(v) {
for (Vehicle *v : Vehicle::Iterate()) {
byte buff[sizeof(VehicleCargoList)];
memcpy(buff, &v->cargo, sizeof(VehicleCargoList));
v->cargo.InvalidateCache();
assert(memcmp(&v->cargo, buff, sizeof(VehicleCargoList)) == 0);
}
Station *st;
FOR_ALL_STATIONS(st) {
for (Station *st : Station::Iterate()) {
for (CargoID c = 0; c < NUM_CARGO; c++) {
byte buff[sizeof(StationCargoList)];
memcpy(buff, &st->goods[c].cargo, sizeof(StationCargoList));