diff options
author | peter1138 <peter1138@openttd.org> | 2019-02-26 06:45:14 +0000 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-02-26 11:20:23 +0100 |
commit | 7ac17f5ae4576a11d1f16281b656ffcd463ab5ac (patch) | |
tree | 68b9ac881053ccfa18eba9655b249be359dded4c /src | |
parent | c2e4a8c9bf6c2e7ceaddb13001adab5b1db916ab (diff) | |
download | openttd-7ac17f5ae4576a11d1f16281b656ffcd463ab5ac.tar.xz |
Fix #7281: Unable to select last group in open livery window on group creation.
Diffstat (limited to 'src')
-rw-r--r-- | src/company_gui.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 5a751a363..143fa0ab8 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1025,9 +1025,15 @@ public: if (data != -1) { /* data contains a VehicleType, rebuild list if it displayed */ if (this->livery_class == data + LC_GROUP_RAIL) { - if (!Group::IsValidID(this->sel)) this->sel = INVALID_GROUP; this->groups.ForceRebuild(); this->BuildGroupList((CompanyID)this->window_number); + this->SetRows(); + + if (!Group::IsValidID(this->sel)) { + this->sel = INVALID_GROUP; + if (this->groups.Length() > 0) this->sel = this->groups[0]->index; + } + this->SetDirty(); } return; |