diff options
author | rubidium <rubidium@openttd.org> | 2011-11-26 12:53:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-26 12:53:05 +0000 |
commit | a9bdd04072b6faaef0502bac497335d2323d9da7 (patch) | |
tree | 9d51afaa68e3bbfb1dcc32f65cd89778b5fbf138 /src | |
parent | 61abe2910818c5f4bc304c21ecea07be65890c9d (diff) | |
download | openttd-a9bdd04072b6faaef0502bac497335d2323d9da7.tar.xz |
(svn r23331) -Fix [FS#4851] (rCS, r148): abort building/moving HQ when clicking on the button again, just like when building rail, stations, etc (sbr)
Diffstat (limited to 'src')
-rw-r--r-- | src/company_gui.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 5541993a5..d33a831ce 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2001,6 +2001,11 @@ struct CompanyWindow : Window case CW_WIDGET_BUILD_HQ: if ((byte)this->window_number != _local_company) return; + if (this->IsWidgetLowered(CW_WIDGET_BUILD_HQ)) { + ResetObjectToPlace(); + this->RaiseButtons(); + break; + } SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this); SetTileSelectSize(2, 2); this->LowerWidget(CW_WIDGET_BUILD_HQ); @@ -2008,6 +2013,11 @@ struct CompanyWindow : Window break; case CW_WIDGET_RELOCATE_HQ: + if (this->IsWidgetLowered(CW_WIDGET_RELOCATE_HQ)) { + ResetObjectToPlace(); + this->RaiseButtons(); + break; + } SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this); SetTileSelectSize(2, 2); this->LowerWidget(CW_WIDGET_RELOCATE_HQ); |