forked from mirror/OpenTTD
(svn r2492) Remove some pointless casts and fix some nearby indentation
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user