src/date.cpp
changeset 8705 0823c884d748
parent 8640 1e93b81e96d2
child 8743 62a558995c35
equal deleted inserted replaced
8704:2857ec554839 8705:0823c884d748
    13 #include "functions.h"
    13 #include "functions.h"
    14 #include "date_func.h"
    14 #include "date_func.h"
    15 #include "vehicle_base.h"
    15 #include "vehicle_base.h"
    16 #ifdef DEBUG_DUMP_COMMANDS
    16 #ifdef DEBUG_DUMP_COMMANDS
    17 #include "saveload.h"
    17 #include "saveload.h"
       
    18 #include "town_map.h"
    18 #endif
    19 #endif
    19 
    20 
    20 Year      _cur_year;
    21 Year      _cur_year;
    21 Month     _cur_month;
    22 Month     _cur_month;
    22 Date      _date;
    23 Date      _date;
   265 	_cur_month = ymd.month;
   266 	_cur_month = ymd.month;
   266 
   267 
   267 	/* yes, call various monthly loops */
   268 	/* yes, call various monthly loops */
   268 	if (_game_mode != GM_MENU) {
   269 	if (_game_mode != GM_MENU) {
   269 #ifdef DEBUG_DUMP_COMMANDS
   270 #ifdef DEBUG_DUMP_COMMANDS
       
   271 		std::map<TownID, uint32> town_pop;
       
   272 		for (TileIndex t = 0; t < MapSize(); t++) {
       
   273 			if (GetTileType(t) == MP_HOUSE && IsHouseCompleted(t)) {
       
   274 				uint32 pop = GetHouseSpecs(GetHouseType(t))->population;
       
   275 				town_pop[GetTownIndex(t)] += pop;
       
   276 			}
       
   277 		}
       
   278 
       
   279 		Town *t;
       
   280 		FOR_ALL_TOWNS(t) assert(t->population == town_pop[t->index]);
       
   281 
   270 		char name[MAX_PATH];
   282 		char name[MAX_PATH];
   271 		snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
   283 		snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
   272 		SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
   284 		SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
   273 		debug_dump_commands("ddc:save:%s\n", name);
   285 		debug_dump_commands("ddc:save:%s\n", name);
   274 #endif /* DUMP_COMMANDS */
   286 #endif /* DUMP_COMMANDS */