summaryrefslogtreecommitdiff
path: root/src/vehiclelist.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
commit141001d031455b954dc98647e9b9ea6581dae764 (patch)
tree0187f4162e6e574d8191d24993c7ca782e70d6f5 /src/vehiclelist.cpp
parent66b9ea9a5afeafac9fbc49e993bba4c9056f83b2 (diff)
downloadopenttd-141001d031455b954dc98647e9b9ea6581dae764.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/vehiclelist.cpp')
-rw-r--r--src/vehiclelist.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp
index 9f2d09c35..2341a31ad 100644
--- a/src/vehiclelist.cpp
+++ b/src/vehiclelist.cpp
@@ -93,15 +93,9 @@ void GenerateVehicleSortList(VehicleList *list, VehicleType type, PlayerID owner
break;
case VLW_SHARED_ORDERS:
- FOR_ALL_VEHICLES(v) {
- /* Find a vehicle with the order in question */
- if (v->orders != NULL && v->orders->index == index) {
- /* Add all vehicles from this vehicle's shared order list */
- for (v = v->FirstShared(); v != NULL; v = v->NextShared()) {
- *list->Append() = v;
- }
- break;
- }
+ /* Add all vehicles from this vehicle's shared order list */
+ for (v = GetVehicle(index); v != NULL; v = v->NextShared()) {
+ *list->Append() = v;
}
break;