diff options
author | yexo <yexo@openttd.org> | 2011-05-27 15:31:54 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2011-05-27 15:31:54 +0000 |
commit | 4ac6f2a994a8a58b3fbcbabc5215bd40c980ec58 (patch) | |
tree | d05bb5fe8dee4a9dd9c41b2f2b37bdfb4feb9657 /src | |
parent | a222703d4c0059b2f35e9f89472febbbc857879b (diff) | |
download | openttd-4ac6f2a994a8a58b3fbcbabc5215bd40c980ec58.tar.xz |
(svn r22494) -Fix: airport preview sprite can depend on the layout, so update the cached SpriteID when the layout changes
Diffstat (limited to 'src')
-rw-r--r-- | src/airport_gui.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 56f90b8c4..08d938f91 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -422,11 +422,6 @@ public: _selected_airport_index = airport_index; _selected_airport_layout = 0; - if (_selected_airport_index != -1) { - const AirportSpec *as = AirportClass::Get(_selected_airport_class, _selected_airport_index); - this->preview_sprite = GetCustomAirportSprite(as, _selected_airport_layout); - } - this->UpdateSelectSize(); this->SetDirty(); } @@ -445,6 +440,8 @@ public: if (rotation == DIR_E || rotation == DIR_W) Swap(w, h); SetTileSelectSize(w, h); + this->preview_sprite = GetCustomAirportSprite(as, _selected_airport_layout); + this->SetWidgetDisabledState(BAIRW_LAYOUT_DECREASE, _selected_airport_layout == 0); this->SetWidgetDisabledState(BAIRW_LAYOUT_INCREASE, _selected_airport_layout + 1 >= as->num_table); |