mirror of https://github.com/OpenTTD/OpenTTD
(svn r11772) -Change: add some extra checking in the hope to find the cause of FS#1335
parent
acc7c9eb01
commit
119b03ea70
12
src/date.cpp
12
src/date.cpp
|
@ -15,6 +15,7 @@
|
||||||
#include "vehicle_base.h"
|
#include "vehicle_base.h"
|
||||||
#ifdef DEBUG_DUMP_COMMANDS
|
#ifdef DEBUG_DUMP_COMMANDS
|
||||||
#include "saveload.h"
|
#include "saveload.h"
|
||||||
|
#include "town_map.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Year _cur_year;
|
Year _cur_year;
|
||||||
|
@ -267,6 +268,17 @@ void IncreaseDate()
|
||||||
/* yes, call various monthly loops */
|
/* yes, call various monthly loops */
|
||||||
if (_game_mode != GM_MENU) {
|
if (_game_mode != GM_MENU) {
|
||||||
#ifdef DEBUG_DUMP_COMMANDS
|
#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];
|
char name[MAX_PATH];
|
||||||
snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
|
snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
|
||||||
SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
|
SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#ifndef STDAFX_H
|
#ifndef STDAFX_H
|
||||||
#define STDAFX_H
|
#define STDAFX_H
|
||||||
|
#define DEBUG_DUMP_COMMANDS
|
||||||
|
|
||||||
/* It seems that we need to include stdint.h before anything else
|
/* 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
|
* We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
|
||||||
|
|
Loading…
Reference in New Issue