From 9e9ea7fa813892e8a5d00dfd373e62a5e562f0ec Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 26 Nov 2011 12:53:05 +0000 Subject: [PATCH] (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) --- src/company_gui.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 5541993a5d..d33a831ce2 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);