summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2020-05-07 01:14:22 +0200
committerGitHub <noreply@github.com>2020-05-07 01:14:22 +0200
commit86e9326b7f9a0f74e5e8b271289685a1d5deeaf2 (patch)
tree1359ede4a29f28fc0a45b4bdc24d1608182030bb /src
parentbc8333723ccf0ea5e889a6bc412c89ea623138bc (diff)
downloadopenttd-86e9326b7f9a0f74e5e8b271289685a1d5deeaf2.tar.xz
Add: docking tiles cache check (#8120)
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index ffd30cf7b..9bd3bf7d0 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1317,6 +1317,23 @@ static void CheckCaches()
st->goods[c].cargo.InvalidateCache();
assert(memcmp(&st->goods[c].cargo, buff, sizeof(StationCargoList)) == 0);
}
+
+ /* Check docking tiles */
+ TileArea ta;
+ std::map<TileIndex, bool> docking_tiles;
+ TILE_AREA_LOOP(tile, st->docking_station) {
+ ta.Add(tile);
+ docking_tiles[tile] = IsDockingTile(tile);
+ }
+ UpdateStationDockingTiles(st);
+ if (ta.tile != st->docking_station.tile || ta.w != st->docking_station.w || ta.h != st->docking_station.h) {
+ DEBUG(desync, 2, "station docking mismatch: station %i, company %i", st->index, (int)st->owner);
+ }
+ TILE_AREA_LOOP(tile, ta) {
+ if (docking_tiles[tile] != IsDockingTile(tile)) {
+ DEBUG(desync, 2, "docking tile mismatch: tile %i", (int)tile);
+ }
+ }
}
}