Dump infrastructure totals when mismatch detected in CheckCaches.

This commit is contained in:
Jonathan G Rennison
2017-02-22 02:47:53 +00:00
parent e11f295b29
commit 3813b3ca09
3 changed files with 22 additions and 0 deletions

View File

@@ -1317,6 +1317,11 @@ void CheckCaches(bool force_check)
FOR_ALL_COMPANIES(c) {
if (MemCmpT(old_infrastructure.Get(i), &c->infrastructure) != 0) {
DEBUG(desync, 0, "infrastructure cache mismatch: company %i", (int)c->index);
char buffer[4096];
old_infrastructure.Get(i)->Dump(buffer, lastof(buffer));
DEBUG(desync, 0, "Previous:\n%s", buffer);
c->infrastructure.Dump(buffer, lastof(buffer));
DEBUG(desync, 0, "Recalculated:\n%s", buffer);
}
i++;
}