summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-17 21:07:09 +0000
committerrubidium <rubidium@openttd.org>2008-08-17 21:07:09 +0000
commit99efe9aaae2f7d6d39ab694e0be9981b738661ec (patch)
tree0187f4162e6e574d8191d24993c7ca782e70d6f5 /src/vehicle_gui.cpp
parentabd9f748715c3f1278d54637c725e18d5cbe5bd5 (diff)
downloadopenttd-99efe9aaae2f7d6d39ab694e0be9981b738661ec.tar.xz
(svn r14097) -Fix [FS#2085]: one couldn't get a list of vehicles sharing an order when the number of orders was 0; you could see that the vehicles had a shared order though.
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)