diff options
author | celestar <celestar@openttd.org> | 2005-02-01 09:47:18 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2005-02-01 09:47:18 +0000 |
commit | ecbe6e2be43520e86b4bc7c88ccd24200b4b2fc9 (patch) | |
tree | faf9ecb2ce10ec8d713f3f7628cd1265b491aacd | |
parent | eb21ec63a3c88700f64c6d83c6f03e978c397d35 (diff) | |
download | openttd-ecbe6e2be43520e86b4bc7c88ccd24200b4b2fc9.tar.xz |
(svn r1760) -Fix: [ 1113399 ] Game no longer crashes when right-clicking a disabled Full Load button
-rw-r--r-- | order_gui.c | 9 |
1 files 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: { |