mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r16522) -Fix [FS#2962]: possible assert in ai debug window when an AI was stopped an a human company took it's CompanyID
This commit is contained in:
parent
a75f564af4
commit
8dba8371e3
@ -660,7 +660,7 @@ struct AIDebugWindow : public Window {
|
|||||||
virtual void OnPaint()
|
virtual void OnPaint()
|
||||||
{
|
{
|
||||||
/* Check if the currently selected company is still active. */
|
/* 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) {
|
if (ai_debug_company != INVALID_COMPANY) {
|
||||||
/* Raise and disable the widget for the previous selection. */
|
/* Raise and disable the widget for the previous selection. */
|
||||||
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
|
this->RaiseWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START);
|
||||||
|
Loading…
Reference in New Issue
Block a user