1
0
Fork 0

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

pull/8964/head
Bernard Teo 2021-04-07 02:30:35 +08:00 committed by GitHub
parent 2f5035d6dc
commit f0a24e98f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -892,8 +892,12 @@ public:
/* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */ /* We do not support VehicleClicked() here since the contextual action may only make sense for individual vehicles */
if (vindex == v->index) { if (vindex == v->index) {
if (vehgroup.NumVehicles() == 1) {
ShowVehicleViewWindow(v);
} else {
ShowVehicleListWindow(v); ShowVehicleListWindow(v);
} }
}
break; break;
} }

View File

@ -1830,12 +1830,18 @@ public:
break; break;
} }
case GB_SHARED_ORDERS: case GB_SHARED_ORDERS: {
assert(vehgroup.NumVehicles() > 0); 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 */ /* 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; break;
}
default: NOT_REACHED(); default: NOT_REACHED();
} }