summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-02-26 22:13:24 +0000
committerPatric Stout <truebrain@openttd.org>2019-03-03 13:13:35 +0100
commit93a6fd42d1a9eec51943182a8c9ed983e8b2d5b1 (patch)
treec39d83ec8c4b6426f08ca2295dc715febc85954d
parentc61acc7fc1fc6bbc1e5b1d0a782e74ecf16a9a23 (diff)
downloadopenttd-93a6fd42d1a9eec51943182a8c9ed983e8b2d5b1.tar.xz
Fix 23960d0f2c: Company livery window shows incorrect groups when opened from group window in multiplayer.
-rw-r--r--src/company_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 143fa0ab8..a3885ec96 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -707,7 +707,7 @@ public:
this->BuildGroupList(company);
this->SetRows();
} else {
- this->SetSelectedGroup(group);
+ this->SetSelectedGroup(company, group);
}
this->FinishInitNested(company);
@@ -715,7 +715,7 @@ public:
this->InvalidateData(1);
}
- void SetSelectedGroup(GroupID group)
+ void SetSelectedGroup(CompanyID company, GroupID group)
{
this->RaiseWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
const Group *g = Group::Get(group);
@@ -730,7 +730,7 @@ public:
this->LowerWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
this->groups.ForceRebuild();
- this->BuildGroupList((CompanyID)this->window_number);
+ this->BuildGroupList(company);
this->SetRows();
/* Position scrollbar to selected group */
@@ -1105,7 +1105,7 @@ void ShowCompanyLiveryWindow(CompanyID company, GroupID group)
if (w == NULL) {
new SelectCompanyLiveryWindow(&_select_company_livery_desc, company, group);
} else if (group != INVALID_GROUP) {
- w->SetSelectedGroup(group);
+ w->SetSelectedGroup(company, group);
}
}