diff options
author | alberth <alberth@openttd.org> | 2009-10-11 08:23:30 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-10-11 08:23:30 +0000 |
commit | 9677e51261f794e88dc6b5722e48d786306ecb21 (patch) | |
tree | 8e67e8ac55ec7164a4b8f4dc4c641649db88c3be | |
parent | f9733ac590e2be09045ece94ff7fc68be61fdacd (diff) | |
download | openttd-9677e51261f794e88dc6b5722e48d786306ecb21.tar.xz |
(svn r17760) -Revert (r17648): _local_company is less constant than you'd expect.
-rw-r--r-- | src/depot_gui.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 6656cb116..d61a3fa87 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -234,18 +234,6 @@ struct DepotWindow : Window { this->window_number = tile; this->SetupWidgetData(type); - /* Setup disabled buttons. */ - this->SetWidgetsDisabledState(!IsTileOwner(tile, _local_company), - DEPOT_WIDGET_STOP_ALL, - DEPOT_WIDGET_START_ALL, - DEPOT_WIDGET_SELL, - DEPOT_WIDGET_SELL_CHAIN, - DEPOT_WIDGET_SELL_ALL, - DEPOT_WIDGET_BUILD, - DEPOT_WIDGET_CLONE, - DEPOT_WIDGET_AUTOREPLACE, - WIDGET_LIST_END); - this->FinishInitNested(desc, tile); this->owner = GetTileOwner(tile); this->CreateDepotListWindow(type); @@ -672,6 +660,19 @@ struct DepotWindow : Window { this->vscroll.SetCount((this->vehicle_list.Length() + this->hscroll.GetCapacity() - 1) / this->hscroll.GetCapacity()); } + /* Setup disabled buttons. */ + TileIndex tile = this->window_number; + this->SetWidgetsDisabledState(!IsTileOwner(tile, _local_company), + DEPOT_WIDGET_STOP_ALL, + DEPOT_WIDGET_START_ALL, + DEPOT_WIDGET_SELL, + DEPOT_WIDGET_SELL_CHAIN, + DEPOT_WIDGET_SELL_ALL, + DEPOT_WIDGET_BUILD, + DEPOT_WIDGET_CLONE, + DEPOT_WIDGET_AUTOREPLACE, + WIDGET_LIST_END); + this->DrawWidgets(); } |