roadveh_gui.c
changeset 1986 5dd3db2b86d7
parent 1977 4392ae3d8e31
child 2084 d67790a49f78
--- a/roadveh_gui.c	Sun Jun 26 21:59:21 2005 +0000
+++ b/roadveh_gui.c	Mon Jun 27 06:57:24 2005 +0000
@@ -540,9 +540,8 @@
 	/* determine amount of items for scroller */
 	num = 0;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road && v->u.road.state == 254 &&
-				v->tile == (TileIndex)tile)
-					num++;
+		if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile)
+			num++;
 	}
 	SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
 
@@ -558,11 +557,8 @@
 	num = w->vscroll.pos * w->hscroll.cap;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road &&
-				v->u.road.state == 254 &&
-				v->tile == (TileIndex)tile &&
+		if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile &&
 				--num < 0 && num >=	-w->vscroll.cap * w->hscroll.cap) {
-
 			DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel);
 
 			SetDParam(0, v->unitnumber);
@@ -598,19 +594,13 @@
 
 	tile = w->window_number;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road &&
-				v->u.road.state == 254 &&
-				v->tile == (TileIndex)tile &&
+		if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile &&
 				--pos < 0) {
-					*veh = v;
-					if (xm >= 24)
-						return 0;
-
-					if (xm <= 16)
-						return -1; /* show window */
-
-					return -2; /* start stop */
-				}
+			*veh = v;
+			if (xm >= 24) return 0;
+			if (xm <= 16) return -1; /* show window */
+			return -2; /* start stop */
+		}
 	}
 
 	return 1; /* outside */