mirror of https://github.com/OpenTTD/OpenTTD
(svn r24723) -Fix: AI debug GUI crashed when using disabled buttons via hotkeys.
parent
4aa17c5109
commit
8cd77b6f6e
|
@ -1268,12 +1268,12 @@ struct AIDebugWindow : public QueryStringBaseWindow {
|
|||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
{
|
||||
/* Also called for hotkeys, so check for disabledness */
|
||||
if (this->IsWidgetDisabled(widget)) return;
|
||||
|
||||
/* Check which button is clicked */
|
||||
if (IsInsideMM(widget, WID_AID_COMPANY_BUTTON_START, WID_AID_COMPANY_BUTTON_END + 1)) {
|
||||
/* Is it no on disable? */
|
||||
if (!this->IsWidgetDisabled(widget)) {
|
||||
ChangeToAI((CompanyID)(widget - WID_AID_COMPANY_BUTTON_START));
|
||||
}
|
||||
ChangeToAI((CompanyID)(widget - WID_AID_COMPANY_BUTTON_START));
|
||||
}
|
||||
|
||||
switch (widget) {
|
||||
|
|
Loading…
Reference in New Issue