From bdc8a59ff4f3da26d2f96d29ec123d2f16f30fe1 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 30 Apr 2011 17:08:18 +0000 Subject: (svn r22386) -Fix [FS#4602]: When the last AI company gets removed, the 'dead' state was not reset in the AI debug window. --- src/ai/ai_gui.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/ai') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 7d2b1fecd..1f57b8ebc 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -816,9 +816,8 @@ struct AIDebugWindow : public QueryStringBaseWindow { /* Check if the currently selected company is still active. */ if (ai_debug_company == INVALID_COMPANY || !Company::IsValidAiID(ai_debug_company)) { if (ai_debug_company != INVALID_COMPANY) { - /* Raise and disable the widget for the previous selection. */ + /* Raise the widget for the previous selection. */ this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); - this->DisableWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); ai_debug_company = INVALID_COMPANY; } @@ -848,9 +847,6 @@ struct AIDebugWindow : public QueryStringBaseWindow { if (this->show_break_box) this->DrawEditBox(AID_WIDGET_BREAK_STR_EDIT_BOX); - /* If there are no active companies, don't display anything else. */ - if (ai_debug_company == INVALID_COMPANY) return; - /* Paint the company icons */ for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) { NWidgetCore *button = this->GetWidget(i + AID_WIDGET_COMPANY_BUTTON_START); @@ -881,6 +877,9 @@ struct AIDebugWindow : public QueryStringBaseWindow { DrawCompanyIcon(i, button->pos_x + button->current_x / 2 - 7 + offset, this->GetWidget(AID_WIDGET_COMPANY_BUTTON_START + i)->pos_y + 2 + offset); } + /* If there are no active companies, don't display anything else. */ + if (ai_debug_company == INVALID_COMPANY) return; + Backup cur_company(_current_company, ai_debug_company, FILE_LINE); AILog::LogData *log = (AILog::LogData *)AIObject::GetLogPointer(); cur_company.Restore(); -- cgit v1.2.3-54-g00ecf