Mercurial > hg > openttd
changeset 9475:c93ddf309a10 draft
(svn r13409) -Fix: division by zero when one would press 'd' (skip order) when there's no order.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 08 Jun 2008 09:14:30 +0000 |
parents | 778ccd64c8dd |
children | bba7a506af6d |
files | src/order_gui.cpp |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -566,6 +566,7 @@ { /* 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));