diff -r 4be0426ddcc0 src/order_gui.cpp --- a/src/order_gui.cpp Wed Nov 10 17:49:44 2010 +0000 +++ b/src/order_gui.cpp Wed Nov 10 18:57:41 2010 +0100 @@ -751,6 +751,9 @@ virtual void OnInvalidateData(int data) { + VehicleOrderID from = GB(data, 0, 8); + VehicleOrderID to = GB(data, 8, 8); + switch (data) { case 0: /* Autoreplace replaced the vehicle */ @@ -775,9 +778,6 @@ * the order is being created / removed */ if (this->selected_order == -1) break; - VehicleOrderID from = GB(data, 0, 8); - VehicleOrderID to = GB(data, 8, 8); - if (from == to) break; // no need to change anything if (from != this->selected_order) { @@ -804,6 +804,11 @@ } this->vscroll->SetCount(this->vehicle->GetNumOrders() + 1); + + /* Auto scroll new order */ + if(to != INVALID_VEH_ORDER_ID && !this->vscroll->IsVisible(to)) + this->vscroll->ScrollTowards(to); + this->UpdateButtonState(); }