From ab7b8b50e34ffe0f0205399fc3a0fcefcff31741 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 27 Jun 2005 06:57:24 +0000 Subject: (svn r2492) Remove some pointless casts and fix some nearby indentation --- ship_gui.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'ship_gui.c') diff --git a/ship_gui.c b/ship_gui.c index 392526dce..f27bf458c 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -616,9 +616,8 @@ static void DrawShipDepotWindow(Window *w) /* determine amount of items for scroller */ num = 0; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Ship && v->u.ship.state == 0x80 && - v->tile == (TileIndex)tile) - num++; + if (v->type == VEH_Ship && v->u.ship.state == 0x80 && v->tile == tile) + num++; } SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap); @@ -634,11 +633,8 @@ static void DrawShipDepotWindow(Window *w) num = w->vscroll.pos * w->hscroll.cap; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Ship && - v->u.ship.state == 0x80 && - v->tile == (TileIndex)tile && + if (v->type == VEH_Ship && v->u.ship.state == 0x80 && v->tile == tile && --num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) { - DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel); SetDParam(0, v->unitnumber); @@ -675,17 +671,13 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh) tile = w->window_number; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Ship && - v->vehstatus&VS_HIDDEN && - v->tile == (TileIndex)tile && + if (v->type == VEH_Ship && v->vehstatus & VS_HIDDEN && v->tile == tile && --pos < 0) { - *veh = v; - if (xm >= 19) - return 0; - if (ym <= 10) - return -1; /* show window */ - return -2; /* start stop */ - } + *veh = v; + if (xm >= 19) return 0; + if (ym <= 10) return -1; /* show window */ + return -2; /* start stop */ + } } return 1; /* outside */ -- cgit v1.2.3-54-g00ecf