summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-27 06:57:24 +0000
committertron <tron@openttd.org>2005-06-27 06:57:24 +0000
commit5cbd8b598ced72ad2756c40d3c4fc15a9f247fc9 (patch)
tree25912342dc104ba143e6030a35c59234dac9aef9 /ship_gui.c
parent48ff5e39dc523dcfd448006ab3232599e2792178 (diff)
downloadopenttd-5cbd8b598ced72ad2756c40d3c4fc15a9f247fc9.tar.xz
(svn r2492) Remove some pointless casts and fix some nearby indentation
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c26
1 files changed, 9 insertions, 17 deletions
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 */