summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorBernard Teo <btzy1996@hotmail.com>2021-04-07 02:30:35 +0800
committerGitHub <noreply@github.com>2021-04-06 19:30:35 +0100
commitf0a24e98f55def996b0913690736f4c708fc4c55 (patch)
tree98cb8fa4950eedf4a7e0efe61b939ae398a277e8 /src/vehicle_gui.cpp
parent2f5035d6dc6a1daf4884d85288349bfdd726f210 (diff)
downloadopenttd-f0a24e98f55def996b0913690736f4c708fc4c55.tar.xz
Fix #8922: Show vehicle window for single vehicle in shared order grouping (#8926)
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 5960f0be9..aa2893824 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1830,12 +1830,18 @@ 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();
}