From 468d232ef4c5d7199d20c545427b69708b790ff0 Mon Sep 17 00:00:00 2001 From: zuu Date: Sat, 1 Sep 2012 17:49:26 +0000 Subject: [PATCH] (svn r24505) -Add: Select the GS tab if all AI tabs are unselectable in the AI debug window. --- src/ai/ai_gui.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index e1abe49e5c..6f591038d4 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 */