summaryrefslogtreecommitdiff
path: root/src/ai/ai_gui.cpp
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2010-03-13 00:15:24 +0000
committerYexo <yexo@openttd.org>2010-03-13 00:15:24 +0000
commitdfa528d058e5499558e7fd8dca3b292851f7625a (patch)
tree7965c3366300677028430c11012a986ddf18ffc2 /src/ai/ai_gui.cpp
parentd0b496feb63980b1ec9bf402b7fa2c236e07f999 (diff)
downloadopenttd-dfa528d058e5499558e7fd8dca3b292851f7625a.tar.xz
(svn r19395) -Fix [FS#3669]: the AI Debug window didn't open if an AI or library fails to compile when loading a savegame
Diffstat (limited to 'src/ai/ai_gui.cpp')
-rw-r--r--src/ai/ai_gui.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index c7ff796d9..a297f74aa 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -1024,3 +1024,15 @@ void InitializeAIGui()
{
AIDebugWindow::ai_debug_company = INVALID_COMPANY;
}
+
+/** Open the AI debug window if one of the AI scripts has crashed. */
+void ShowAIDebugWindowIfAIError()
+{
+ Company *c;
+ FOR_ALL_COMPANIES(c) {
+ if (c->is_ai && c->ai_instance->IsDead()) {
+ ShowAIDebugWindow(c->index);
+ break;
+ }
+ }
+}