Fix #8922: Show vehicle window for single vehicle in shared order grouping

This commit is contained in:
Bernard Teo
2021-04-02 03:14:24 +08:00
committed by dP
parent c92a198ef5
commit 036b73a4e1
2 changed files with 15 additions and 3 deletions

View File

@@ -1833,12 +1833,19 @@ public:
break;
}
case GB_SHARED_ORDERS:
case GB_SHARED_ORDERS: {
assert(vehgroup.NumVehicles() > 0);
const Vehicle *v = vehgroup.vehicles_begin[0];
/* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */
ShowVehicleListWindow(vehgroup.vehicles_begin[0]);
if (vehgroup.NumVehicles() == 1) {
ShowVehicleViewWindow(v);
}
else {
ShowVehicleListWindow(v);
}
break;
}
default: NOT_REACHED();
}