diff --git a/src/order_gui.cpp b/src/order_gui.cpp --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -793,8 +793,7 @@ public: if (_settings_client.gui.quick_goto && v->owner == _local_company) { /* If there are less than 2 station, make Go To active. */ int station_orders = 0; - const Order *order; - FOR_VEHICLE_ORDERS(v, order) { + for(const Order *order : v->Orders()) { if (order->IsType(OT_GOTO_STATION)) station_orders++; }