summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-03 23:40:13 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-03 23:40:13 +0000
commitd30fcd4e354325af0d2b1968cd11c9db36a3e617 (patch)
treeb69954355d81dd316ec4fcbeddcd117fecb1edee /src/openttd.cpp
parent6083d6ffb4b10ffd6e23e27183000cdb190d1ac7 (diff)
downloadopenttd-d30fcd4e354325af0d2b1968cd11c9db36a3e617.tar.xz
(svn r23411) -Add: Company infrastructure counts for rail.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index d20a2c33a..520589b8e 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1115,6 +1115,22 @@ void SwitchToMode(SwitchMode new_mode)
*/
static void CheckCaches()
{
+ /* Check company infrastructure cache. */
+ SmallVector<CompanyInfrastructure, 4> old_infrastructure;
+ Company *c;
+ FOR_ALL_COMPANIES(c) MemCpyT(old_infrastructure.Append(), &c->infrastructure);
+
+ extern void AfterLoadCompanyStats();
+ AfterLoadCompanyStats();
+
+ uint i = 0;
+ FOR_ALL_COMPANIES(c) {
+ if (MemCmpT(old_infrastructure.Get(i), &c->infrastructure) != 0) {
+ DEBUG(desync, 2, "infrastructure cache mismatch: company %i", c->index);
+ }
+ i++;
+ }
+
/* Return here so it is easy to add checks that are run
* always to aid testing of caches. */
if (_debug_desync_level <= 1) return;