diff options
author | rubidium <rubidium@openttd.org> | 2008-06-08 09:14:30 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-06-08 09:14:30 +0000 |
commit | b1dc70549245677303a1fdc0da57df92d80242fa (patch) | |
tree | 68b403d083cf6185007321ff663c28ac250efa2d /src | |
parent | d083afea90f1eb470dbc01e268d2d9a09238d5d2 (diff) | |
download | openttd-b1dc70549245677303a1fdc0da57df92d80242fa.tar.xz |
(svn r13409) -Fix: division by zero when one would press 'd' (skip order) when there's no order.
Diffstat (limited to 'src')
-rw-r--r-- | src/order_gui.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index b38a9501c..bcb971282 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -566,6 +566,7 @@ private: { /* Don't skip when there's nothing to skip */ if (_ctrl_pressed && w->vehicle->cur_order_index == w->OrderGetSel()) return; + if (w->vehicle->num_orders == 0) return; DoCommandP(w->vehicle->tile, w->vehicle->index, _ctrl_pressed ? w->OrderGetSel() : ((w->vehicle->cur_order_index + 1) % w->vehicle->num_orders), NULL, CMD_SKIP_TO_ORDER | CMD_MSG(_ctrl_pressed ? STR_CAN_T_SKIP_TO_ORDER : STR_CAN_T_SKIP_ORDER)); |