summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-12 17:32:24 +0000
committerrubidium <rubidium@openttd.org>2009-09-12 17:32:24 +0000
commit9894e025a4cd24aaa2a58559f38ca6cf1d8e06d9 (patch)
treeba00593e877dcaf5e3cf6242efb78ef211498d19 /src
parentd0de94be99964427ddfe5eb737c3bfd069782f30 (diff)
downloadopenttd-9894e025a4cd24aaa2a58559f38ca6cf1d8e06d9.tar.xz
(svn r17512) -Add: some basic information about the loaded AIs in the crash log
Diffstat (limited to 'src')
-rw-r--r--src/crashlog.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crashlog.cpp b/src/crashlog.cpp
index 01678bea3..60679172f 100644
--- a/src/crashlog.cpp
+++ b/src/crashlog.cpp
@@ -24,6 +24,10 @@
#include "video/video_driver.hpp"
#include "saveload/saveload.h"
+#include <squirrel.h>
+#include "ai/ai_info.hpp"
+#include "company_base.h"
+
#include <time.h>
/* static */ const char *CrashLog::message = NULL;
@@ -94,6 +98,17 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
_video_driver == NULL ? "none" : _video_driver->GetName()
);
+ buffer += seprintf(buffer, last, "AI Configuration:\n");
+ const Company *c;
+ FOR_ALL_COMPANIES(c) {
+ if (c->ai_info == NULL) {
+ buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index);
+ } else {
+ buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion());
+ }
+ }
+ buffer += seprintf(buffer, last, "\n");
+
return buffer;
}