From ecbe6e2be43520e86b4bc7c88ccd24200b4b2fc9 Mon Sep 17 00:00:00 2001 From: celestar Date: Tue, 1 Feb 2005 09:47:18 +0000 Subject: (svn r1760) -Fix: [ 1113399 ] Game no longer crashes when right-clicking a disabled Full Load button --- order_gui.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/order_gui.c b/order_gui.c index 9cba6e291..df4db8f19 100644 --- a/order_gui.c +++ b/order_gui.c @@ -458,11 +458,12 @@ static void OrdersWndProc(Window *w, WindowEvent *e) case WE_RCLICK: { Vehicle *v = GetVehicle(w->window_number); - if (e->click.widget != 8) break; - if (GetVehicleOrder(v, OrderGetSel(w))->type == OT_GOTO_DEPOT) - GuiShowTooltips(STR_SERVICE_HINT); - else + int sel = OrderGetSel(w); + if (e->click.widget != 8) break; + if (sel == v->num_orders || GetVehicleOrder(v, sel)->type != OT_GOTO_DEPOT) GuiShowTooltips(STR_8857_MAKE_THE_HIGHLIGHTED_ORDER); + else + GuiShowTooltips(STR_SERVICE_HINT); } break; case WE_4: { -- cgit v1.2.3-70-g09d2