summaryrefslogtreecommitdiff
path: root/src/date.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-06 22:29:47 +0000
committerrubidium <rubidium@openttd.org>2007-12-06 22:29:47 +0000
commit42dbdbb7f91223dfe3cd13c0f05d035e78171373 (patch)
tree07242c652ed4cfe3b56eb0704fd2db3a15405741 /src/date.cpp
parentdd68a34e263bcb7122d872e21af291098597b75b (diff)
downloadopenttd-42dbdbb7f91223dfe3cd13c0f05d035e78171373.tar.xz
(svn r11584) -Change: add some extra checking in the hope to find the cause of FS#1482.
Diffstat (limited to 'src/date.cpp')
-rw-r--r--src/date.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/date.cpp b/src/date.cpp
index 23354cde1..24888177b 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -267,6 +267,21 @@ void IncreaseDate()
/* yes, call various monthly loops */
if (_game_mode != GM_MENU) {
#ifdef DEBUG_DUMP_COMMANDS
+ int data[MAX_PLAYERS][TOTAL_NUM_ENGINES + 1];
+ memset(data, 0, sizeof(data));
+
+ const Vehicle *v;
+ FOR_ALL_VEHICLES(v) {
+ if (!IsEngineCountable(v)) continue;
+ data[v->owner][v->engine_type]++;
+ }
+
+ for (PlayerID i = PLAYER_FIRST; i < MAX_PLAYERS; i++) {
+ const Player *p = GetPlayer(i);
+ if (!p->is_active) continue;
+ for (int j = 0; j < TOTAL_NUM_ENGINES; j++) assert(data[i][j] == p->num_engines[j]);
+ }
+
char name[MAX_PATH];
snprintf(name, lengthof(name), "dmp_cmds_%d.sav", _date);
SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR);