Mercurial > hg > openttd
changeset 12109:f48988eda1a7 draft
(svn r16522) -Fix [FS#2962]: possible assert in ai debug window when an AI was stopped an a human company took it's CompanyID
author | yexo <yexo@openttd.org> |
---|---|
date | Sat, 06 Jun 2009 01:53:17 +0000 |
parents | 5346f9206c26 |
children | ec2c917b3560 |
files | src/ai/ai_gui.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -660,7 +660,7 @@ virtual void OnPaint() { /* Check if the currently selected company is still active. */ - if (ai_debug_company == INVALID_COMPANY || !Company::IsValidID(ai_debug_company)) { + if (ai_debug_company == INVALID_COMPANY || !Company::IsValidID(ai_debug_company) || !Company::Get(ai_debug_company)->is_ai) { if (ai_debug_company != INVALID_COMPANY) { /* Raise and disable the widget for the previous selection. */ this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);