summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-05 16:40:37 +0100
committerPatric Stout <github@truebrain.nl>2021-01-05 21:56:24 +0100
commitfc474b02fa17f8a8922b7043268e9b6a933b2ce8 (patch)
treeda144ae14eb426edec3300241e2dffd624db3312 /src
parentdff7ee8e1c68199a0dc105e82e588ac097543645 (diff)
downloadopenttd-fc474b02fa17f8a8922b7043268e9b6a933b2ce8.tar.xz
Fix: change all Company planes on paint, not only the first that needs changing
Otherwise it can take a few OnPaint() calls before all planes are set correctly when switching companies.
Diffstat (limited to 'src')
-rw-r--r--src/company_gui.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index e0bafda87..f55c801d4 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -2294,7 +2294,7 @@ struct CompanyWindow : Window
if (plane != wi->shown_plane) {
wi->SetDisplayedPlane(plane);
this->InvalidateData();
- return;
+ reinit = true;
}
/* Build HQ button handling. */
@@ -2302,8 +2302,7 @@ struct CompanyWindow : Window
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_VIEW_BUILD_HQ);
if (plane != wi->shown_plane) {
wi->SetDisplayedPlane(plane);
- this->SetDirty();
- return;
+ reinit = true;
}
this->SetWidgetDisabledState(WID_C_VIEW_HQ, c->location_of_HQ == INVALID_TILE);
@@ -2313,8 +2312,7 @@ struct CompanyWindow : Window
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_RELOCATE);
if (plane != wi->shown_plane) {
wi->SetDisplayedPlane(plane);
- this->SetDirty();
- return;
+ reinit = true;
}
/* Owners of company */