summaryrefslogtreecommitdiff
path: root/order_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-27 21:25:53 +0000
committertron <tron@openttd.org>2006-06-27 21:25:53 +0000
commit2b27073156f40df263cf653263488b8d72a76236 (patch)
tree1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /order_gui.c
parentc126ce110ee33bffe07dac5283d8a1648dc662b7 (diff)
downloadopenttd-2b27073156f40df263cf653263488b8d72a76236.tar.xz
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'order_gui.c')
-rw-r--r--order_gui.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/order_gui.c b/order_gui.c
index f8f895288..e7425ad63 100644
--- a/order_gui.c
+++ b/order_gui.c
@@ -398,31 +398,24 @@ static void OrdersWndProc(Window *w, WindowEvent *e)
Vehicle *v = GetVehicle(w->window_number);
switch (e->click.widget) {
case 2: { /* orders list */
- int sel;
- sel = (e->click.pt.y - 15) / 10;
+ int sel = (e->click.pt.y - 15) / 10;
- if ((uint)sel >= w->vscroll.cap)
- return;
+ if ((uint)sel >= w->vscroll.cap) return;
sel += w->vscroll.pos;
if (_ctrl_pressed && sel < v->num_orders) {
const Order *ord = GetVehicleOrder(v, sel);
- int xy = 0;
+ TileIndex xy;
+
switch (ord->type) {
- case OT_GOTO_STATION: /* station order */
- xy = GetStation(ord->station)->xy ;
- break;
- case OT_GOTO_DEPOT: /* goto depot order */
- xy = GetDepot(ord->station)->xy;
- break;
- case OT_GOTO_WAYPOINT: /* goto waypoint order */
- xy = GetWaypoint(ord->station)->xy;
+ case OT_GOTO_STATION: xy = GetStation(ord->station)->xy ; break;
+ case OT_GOTO_DEPOT: xy = GetDepot(ord->station)->xy; break;
+ case OT_GOTO_WAYPOINT: xy = GetWaypoint(ord->station)->xy; break;
+ default: xy = 0; break;
}
- if (xy)
- ScrollMainWindowToTile(xy);
-
+ if (xy != 0) ScrollMainWindowToTile(xy);
return;
}
@@ -518,7 +511,6 @@ static void OrdersWndProc(Window *w, WindowEvent *e)
w->vscroll.cap = (w->widget[2].bottom - w->widget[2].top) / 10;
break;
}
-
}
static const Widget _orders_train_widgets[] = {