From 627c042df10f8a7cc8169683713881cff248c1a5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 13 Apr 2009 21:30:21 +0000 Subject: (svn r16056) -Fix (r16037): clicking twice on the "end of orders" crashed. --- src/order_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/order_gui.cpp b/src/order_gui.cpp index b0dfb8f52..e2a93e87b 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -876,7 +876,7 @@ public: /* Deselect clicked order */ this->selected_order = -1; } else if (sel == this->selected_order) { - if (this->vehicle->type == VEH_TRAIN) { + if (this->vehicle->type == VEH_TRAIN && sel < this->vehicle->GetNumOrders()) { DoCommandP(this->vehicle->tile, this->vehicle->index + (sel << 16), MOF_STOP_LOCATION | ((GetVehicleOrder(this->vehicle, sel)->GetStopLocation() + 1) % OSL_END) << 4, CMD_MODIFY_ORDER | CMD_MSG(STR_8835_CAN_T_MODIFY_THIS_ORDER)); -- cgit v1.2.3-70-g09d2