summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
committersmatz <smatz@openttd.org>2009-01-03 17:11:52 +0000
commitafef22e3e7caeb41d94115bfd000b4cce68e430d (patch)
tree1b6c7083c14efc8630c4839005e7b1c3c4610160 /src/company_gui.cpp
parent6512d717e168fd1a5253a7ebe31e772824131de7 (diff)
downloadopenttd-afef22e3e7caeb41d94115bfd000b4cce68e430d.tar.xz
(svn r14812) -Codechange: use INVALID_TILE instead of 0 to mark company without HQ
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index ea3fb2267..0eb616911 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1180,10 +1180,10 @@ struct CompanyWindow : Window
this->SetWidgetHiddenState(CW_WIDGET_COLOR_SCHEME, !local);
this->SetWidgetHiddenState(CW_WIDGET_PRESIDENT_NAME, !local);
this->SetWidgetHiddenState(CW_WIDGET_COMPANY_NAME, !local);
- this->widget[CW_WIDGET_BUILD_VIEW_HQ].data = (local && c->location_of_HQ == 0) ? STR_706F_BUILD_HQ : STR_7072_VIEW_HQ;
- if (local && c->location_of_HQ != 0) this->widget[CW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; //HQ is already built.
- this->SetWidgetDisabledState(CW_WIDGET_BUILD_VIEW_HQ, !local && c->location_of_HQ == 0);
- this->SetWidgetHiddenState(CW_WIDGET_RELOCATE_HQ, !local || c->location_of_HQ == 0);
+ this->widget[CW_WIDGET_BUILD_VIEW_HQ].data = (local && c->location_of_HQ == INVALID_TILE) ? STR_706F_BUILD_HQ : STR_7072_VIEW_HQ;
+ if (local && c->location_of_HQ != INVALID_TILE) this->widget[CW_WIDGET_BUILD_VIEW_HQ].type = WWT_PUSHTXTBTN; //HQ is already built.
+ this->SetWidgetDisabledState(CW_WIDGET_BUILD_VIEW_HQ, !local && c->location_of_HQ == INVALID_TILE);
+ this->SetWidgetHiddenState(CW_WIDGET_RELOCATE_HQ, !local || c->location_of_HQ == INVALID_TILE);
this->SetWidgetHiddenState(CW_WIDGET_BUY_SHARE, local);
this->SetWidgetHiddenState(CW_WIDGET_SELL_SHARE, local);
this->SetWidgetHiddenState(CW_WIDGET_COMPANY_PASSWORD, !local || !_networking);
@@ -1263,7 +1263,7 @@ struct CompanyWindow : Window
case CW_WIDGET_BUILD_VIEW_HQ: {
TileIndex tile = GetCompany((CompanyID)this->window_number)->location_of_HQ;
- if (tile == 0) {
+ if (tile == INVALID_TILE) {
if ((byte)this->window_number != _local_company) return;
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, this);
SetTileSelectSize(2, 2);