summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 076e626d3..84ff470b9 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1074,6 +1074,12 @@ struct VehicleListWindow : public Window, public VehicleListBase {
virtual void OnInvalidateData(int data)
{
+ if (HasBit(data, 15) && (this->window_number & VLW_MASK) == VLW_SHARED_ORDERS) {
+ SB(this->window_number, 16, 16, GB(data, 16, 16));
+ this->vehicles.ForceRebuild();
+ return;
+ }
+
if (data == 0) {
this->vehicles.ForceRebuild();
} else {
@@ -1163,8 +1169,7 @@ void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type)
void ShowVehicleListWindow(const Vehicle *v)
{
- if (v->orders == NULL) return; // no shared list to show
- ShowVehicleListWindowLocal(v->owner, VLW_SHARED_ORDERS, v->type, v->orders->index);
+ ShowVehicleListWindowLocal(v->owner, VLW_SHARED_ORDERS, v->type, v->FirstShared()->index);
}
void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type, StationID station)