summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 6166db2b9..601e7730c 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -90,14 +90,16 @@ void BuildVehicleList(vehiclelist_d *vl, int type, int owner, int station)
const Vehicle *v;
FOR_ALL_VEHICLES(v) {
if (v->type == type && v->subtype <= subtype) {
- const Order *ord;
- for (ord = v->schedule_ptr; ord->type != OT_NOTHING; ++ord)
- if (ord->type == OT_GOTO_STATION && ord->station == station) {
+ const Order *order;
+
+ FOR_VEHICLE_ORDERS(v, order) {
+ if (order->type == OT_GOTO_STATION && order->station == station) {
_vehicle_sort[n].index = v->index;
_vehicle_sort[n].owner = v->owner;
++n;
break;
}
+ }
}
}
} else {