summaryrefslogtreecommitdiff
path: root/roadveh_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
commitab7b8b50e34ffe0f0205399fc3a0fcefcff31741 (patch)
tree25912342dc104ba143e6030a35c59234dac9aef9 /roadveh_gui.c
parent78fed5262724a4521a09fbf921b26a437fdeac41 (diff)
downloadopenttd-ab7b8b50e34ffe0f0205399fc3a0fcefcff31741.tar.xz
(svn r2492) Remove some pointless casts and fix some nearby indentation
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index bb97d9289..e715cd9f3 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -540,9 +540,8 @@ static void DrawRoadDepotWindow(Window *w)
/* 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 @@ static void DrawRoadDepotWindow(Window *w)
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 @@ static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
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 */