changeset 11676:638b09679c29 draft

(svn r16056) -Fix (r16037): clicking twice on the "end of orders" crashed.
author rubidium <rubidium@openttd.org>
date Mon, 13 Apr 2009 21:30:21 +0000
parents bbfd9a6f5172
children 8d40b1680957
files src/order_gui.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -876,7 +876,7 @@
 					/* 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));