summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2012-09-01 17:49:26 +0000
committerzuu <zuu@openttd.org>2012-09-01 17:49:26 +0000
commit468d232ef4c5d7199d20c545427b69708b790ff0 (patch)
treeafefe18a4b142df6f850ea2f14d698d91121d724
parentd2b93c96e75180acb1e157d2db1a5e7b3fdcbcbe (diff)
downloadopenttd-468d232ef4c5d7199d20c545427b69708b790ff0.tar.xz
(svn r24505) -Add: Select the GS tab if all AI tabs are unselectable in the AI debug window.
-rw-r--r--src/ai/ai_gui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index e1abe49e5..6f591038d 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -1072,6 +1072,14 @@ struct AIDebugWindow : public QueryStringBaseWindow {
break;
}
}
+
+ /* If no AI is available, see if there is a game script. */
+ if (ai_debug_company == INVALID_COMPANY && Game::GetInstance() != NULL) {
+ /* Lower the widget corresponding to the game script. */
+ this->LowerWidget(WID_AID_SCRIPT_GAME);
+
+ ai_debug_company = OWNER_DEITY;
+ }
}
/* Update "Reload AI" and "AI settings" buttons */