diff options
author | glx <glx@openttd.org> | 2008-01-07 00:43:03 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-01-07 00:43:03 +0000 |
commit | 119b03ea703c5d37454de4fe1a5e6da4dee0ac1b (patch) | |
tree | 6d9b10c3d232e375d017ca2e61ce1372755a37f7 /src/date.cpp | |
parent | acc7c9eb01b24b31334860594bbb00c85ccd8546 (diff) | |
download | openttd-119b03ea703c5d37454de4fe1a5e6da4dee0ac1b.tar.xz |
(svn r11772) -Change: add some extra checking in the hope to find the cause of FS#1335
Diffstat (limited to 'src/date.cpp')
-rw-r--r-- | src/date.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/date.cpp b/src/date.cpp index 12364dcd4..7c9ac1226 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -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 @@ void IncreaseDate() /* yes, call various monthly loops */ if (_game_mode != GM_MENU) { #ifdef DEBUG_DUMP_COMMANDS + std::map<TownID, uint32> 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); |