# HG changeset patch # User glx # Date 1199666583 0 # Node ID 0823c884d74875a25cefc73e19fd028c07358475 # Parent 2857ec554839288d6f464708f0ea5c52cb95301a (svn r11772) -Change: add some extra checking in the hope to find the cause of FS#1335 diff -r 2857ec554839 -r 0823c884d748 src/date.cpp --- a/src/date.cpp Mon Jan 07 00:19:09 2008 +0000 +++ b/src/date.cpp Mon Jan 07 00:43:03 2008 +0000 @@ -15,6 +15,7 @@ #include "vehicle_base.h" #ifdef DEBUG_DUMP_COMMANDS #include "saveload.h" +#include "town_map.h" #endif Year _cur_year; @@ -267,6 +268,17 @@ /* yes, call various monthly loops */ if (_game_mode != GM_MENU) { #ifdef DEBUG_DUMP_COMMANDS + std::map town_pop; + for (TileIndex t = 0; t < MapSize(); t++) { + if (GetTileType(t) == MP_HOUSE && IsHouseCompleted(t)) { + uint32 pop = GetHouseSpecs(GetHouseType(t))->population; + town_pop[GetTownIndex(t)] += pop; + } + } + + Town *t; + FOR_ALL_TOWNS(t) assert(t->population == town_pop[t->index]); + char name[MAX_PATH]; snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date); SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR); diff -r 2857ec554839 -r 0823c884d748 src/stdafx.h --- a/src/stdafx.h Mon Jan 07 00:19:09 2008 +0000 +++ b/src/stdafx.h Mon Jan 07 00:43:03 2008 +0000 @@ -4,6 +4,7 @@ #ifndef STDAFX_H #define STDAFX_H +#define DEBUG_DUMP_COMMANDS /* It seems that we need to include stdint.h before anything else * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC