summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/company_gui.cpp8
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;