mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r2492) Remove some pointless casts and fix some nearby indentation
This commit is contained in:
parent
78fed52627
commit
ab7b8b50e3
|
@ -641,7 +641,7 @@ static void DrawAircraftDepotWindow(Window *w)
|
||||||
num = 0;
|
num = 0;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Aircraft && v->subtype <= 2 && v->vehstatus&VS_HIDDEN &&
|
if (v->type == VEH_Aircraft && v->subtype <= 2 && v->vehstatus&VS_HIDDEN &&
|
||||||
v->tile == (TileIndex)tile)
|
v->tile == tile)
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
||||||
|
@ -657,7 +657,7 @@ static void DrawAircraftDepotWindow(Window *w)
|
||||||
if (v->type == VEH_Aircraft &&
|
if (v->type == VEH_Aircraft &&
|
||||||
v->subtype <= 2 &&
|
v->subtype <= 2 &&
|
||||||
v->vehstatus&VS_HIDDEN &&
|
v->vehstatus&VS_HIDDEN &&
|
||||||
v->tile == (TileIndex)tile &&
|
v->tile == tile &&
|
||||||
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
||||||
|
|
||||||
DrawAircraftImage(v, x+12, y, WP(w,traindepot_d).sel);
|
DrawAircraftImage(v, x+12, y, WP(w,traindepot_d).sel);
|
||||||
|
@ -695,20 +695,14 @@ static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **v
|
||||||
|
|
||||||
tile = w->window_number;
|
tile = w->window_number;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Aircraft &&
|
if (v->type == VEH_Aircraft && v->subtype <= 2 &&
|
||||||
v->subtype <= 2 &&
|
v->vehstatus & VS_HIDDEN && v->tile == tile &&
|
||||||
v->vehstatus&VS_HIDDEN &&
|
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
--pos < 0) {
|
--pos < 0) {
|
||||||
*veh = v;
|
*veh = v;
|
||||||
if (xm >= 12)
|
if (xm >= 12) return 0;
|
||||||
return 0;
|
if (ym <= 12) return -1; /* show window */
|
||||||
|
return -2; /* start stop */
|
||||||
if (ym <= 12)
|
}
|
||||||
return -1; /* show window */
|
|
||||||
|
|
||||||
return -2; /* start stop */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 1; /* outside */
|
return 1; /* outside */
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,13 +167,12 @@ static bool TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height
|
||||||
ts->modheight_count++;
|
ts->modheight_count++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mod->tile == (TileIndex)tile)
|
if (mod->tile == tile) break;
|
||||||
break;
|
|
||||||
mod++;
|
mod++;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod->tile = (TileIndex)tile;
|
mod->tile = tile;
|
||||||
mod->height = (byte)height;
|
mod->height = (byte)height;
|
||||||
|
|
||||||
ts->cost += _price.terraform;
|
ts->cost += _price.terraform;
|
||||||
|
|
16
pathfind.c
16
pathfind.c
|
@ -22,12 +22,12 @@ static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir)
|
||||||
/* unused hash entry, set the appropriate bit in it and return true
|
/* unused hash entry, set the appropriate bit in it and return true
|
||||||
* to indicate that a bit was set. */
|
* to indicate that a bit was set. */
|
||||||
tpf->hash_head[hash] = bits;
|
tpf->hash_head[hash] = bits;
|
||||||
tpf->hash_tile[hash] = (TileIndex)tile;
|
tpf->hash_tile[hash] = tile;
|
||||||
return true;
|
return true;
|
||||||
} else if (!(val & 0x8000)) {
|
} else if (!(val & 0x8000)) {
|
||||||
/* single tile */
|
/* single tile */
|
||||||
|
|
||||||
if ( (TileIndex)tile == tpf->hash_tile[hash] ) {
|
if (tile == tpf->hash_tile[hash]) {
|
||||||
/* found another bit for the same tile,
|
/* found another bit for the same tile,
|
||||||
* check if this bit is already set, if so, return false */
|
* check if this bit is already set, if so, return false */
|
||||||
if (val & bits)
|
if (val & bits)
|
||||||
|
@ -65,7 +65,7 @@ static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir)
|
||||||
offs = tpf->hash_tile[hash];
|
offs = tpf->hash_tile[hash];
|
||||||
do {
|
do {
|
||||||
link = PATHFIND_GET_LINK_PTR(tpf, offs);
|
link = PATHFIND_GET_LINK_PTR(tpf, offs);
|
||||||
if ( (TileIndex)tile == link->tile) {
|
if (tile == link->tile) {
|
||||||
/* found the tile in the link list,
|
/* found the tile in the link list,
|
||||||
* check if the bit was alrady set, if so return false to indicate that the
|
* check if the bit was alrady set, if so return false to indicate that the
|
||||||
* bit was already set */
|
* bit was already set */
|
||||||
|
@ -86,7 +86,7 @@ static bool TPFSetTileBit(TrackPathFinder *tpf, TileIndex tile, int dir)
|
||||||
|
|
||||||
/* then fill the link with the new info, and establish a ptr from the old
|
/* then fill the link with the new info, and establish a ptr from the old
|
||||||
* link to the new one */
|
* link to the new one */
|
||||||
new_link->tile = (TileIndex)tile;
|
new_link->tile = tile;
|
||||||
new_link->flags = bits;
|
new_link->flags = bits;
|
||||||
new_link->next = 0xFFFF;
|
new_link->next = 0xFFFF;
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ static bool NtpVisit(NewTrackPathFinder *tpf, TileIndex tile, uint dir, uint len
|
||||||
}
|
}
|
||||||
|
|
||||||
if (head != 0xffff) {
|
if (head != 0xffff) {
|
||||||
if ( (TileIndex)tile == tpf->hash_tile[hash] && (head & 0x3) == dir ) {
|
if (tile == tpf->hash_tile[hash] && (head & 0x3) == dir) {
|
||||||
|
|
||||||
// longer length
|
// longer length
|
||||||
if (length >= (head >> 2)) return false;
|
if (length >= (head >> 2)) return false;
|
||||||
|
@ -563,7 +563,7 @@ static bool NtpVisit(NewTrackPathFinder *tpf, TileIndex tile, uint dir, uint len
|
||||||
uint offs = tpf->hash_tile[hash];
|
uint offs = tpf->hash_tile[hash];
|
||||||
do {
|
do {
|
||||||
link = NTP_GET_LINK_PTR(tpf, offs);
|
link = NTP_GET_LINK_PTR(tpf, offs);
|
||||||
if ( (TileIndex)tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
|
if (tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
|
||||||
if (length >= (uint)(link->typelength >> 2)) return false;
|
if (length >= (uint)(link->typelength >> 2)) return false;
|
||||||
link->typelength = dir | (length << 2);
|
link->typelength = dir | (length << 2);
|
||||||
return true;
|
return true;
|
||||||
|
@ -580,7 +580,7 @@ static bool NtpVisit(NewTrackPathFinder *tpf, TileIndex tile, uint dir, uint len
|
||||||
|
|
||||||
/* then fill the link with the new info, and establish a ptr from the old
|
/* then fill the link with the new info, and establish a ptr from the old
|
||||||
* link to the new one */
|
* link to the new one */
|
||||||
new_link->tile = (TileIndex)tile;
|
new_link->tile = tile;
|
||||||
new_link->typelength = dir | (length << 2);
|
new_link->typelength = dir | (length << 2);
|
||||||
new_link->next = 0xFFFF;
|
new_link->next = 0xFFFF;
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ static bool NtpCheck(NewTrackPathFinder *tpf, TileIndex tile, uint dir, uint len
|
||||||
offs = tpf->hash_tile[hash];
|
offs = tpf->hash_tile[hash];
|
||||||
for(;;) {
|
for(;;) {
|
||||||
link = NTP_GET_LINK_PTR(tpf, offs);
|
link = NTP_GET_LINK_PTR(tpf, offs);
|
||||||
if ( (TileIndex)tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
|
if (tile == link->tile && (uint)(link->typelength & 0x3) == dir) {
|
||||||
assert( (uint)(link->typelength >> 2) <= length);
|
assert( (uint)(link->typelength >> 2) <= length);
|
||||||
return length == (uint)(link->typelength >> 2);
|
return length == (uint)(link->typelength >> 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -663,8 +663,7 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
if (_current_player == _local_player)
|
if (_current_player == _local_player) _last_built_train_depot_tile = tile;
|
||||||
_last_built_train_depot_tile = (TileIndex)tile;
|
|
||||||
|
|
||||||
ModifyTile(tile,
|
ModifyTile(tile,
|
||||||
MP_SETTYPE(MP_RAILWAY) |
|
MP_SETTYPE(MP_RAILWAY) |
|
||||||
|
|
|
@ -644,8 +644,7 @@ int32 CmdBuildRoadDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
if (_current_player == _local_player)
|
if (_current_player == _local_player) _last_built_road_depot_tile = tile;
|
||||||
_last_built_road_depot_tile = (TileIndex)tile;
|
|
||||||
|
|
||||||
dep->xy = tile;
|
dep->xy = tile;
|
||||||
dep->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
|
dep->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
|
||||||
|
|
|
@ -907,11 +907,8 @@ typedef struct OvertakeData {
|
||||||
|
|
||||||
static void *EnumFindVehToOvertake(Vehicle *v, OvertakeData *od)
|
static void *EnumFindVehToOvertake(Vehicle *v, OvertakeData *od)
|
||||||
{
|
{
|
||||||
if (v->tile != (TileIndex)od->tile ||
|
if (v->tile != od->tile || v->type != VEH_Road || v == od->u || v == od->v)
|
||||||
v->type != VEH_Road ||
|
return NULL;
|
||||||
v == od->u ||
|
|
||||||
v == od->v)
|
|
||||||
return NULL;
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1079,7 +1076,7 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
|
||||||
if (v->u.road.reverse_ctr != 0) {
|
if (v->u.road.reverse_ctr != 0) {
|
||||||
/* What happens here?? */
|
/* What happens here?? */
|
||||||
v->u.road.reverse_ctr = 0;
|
v->u.road.reverse_ctr = 0;
|
||||||
if (v->tile != (TileIndex)tile) {
|
if (v->tile != tile) {
|
||||||
return_track(_road_reverse_table[enterdir]);
|
return_track(_road_reverse_table[enterdir]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,9 +540,8 @@ static void DrawRoadDepotWindow(Window *w)
|
||||||
/* determine amount of items for scroller */
|
/* determine amount of items for scroller */
|
||||||
num = 0;
|
num = 0;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Road && v->u.road.state == 254 &&
|
if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile)
|
||||||
v->tile == (TileIndex)tile)
|
num++;
|
||||||
num++;
|
|
||||||
}
|
}
|
||||||
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
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;
|
num = w->vscroll.pos * w->hscroll.cap;
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Road &&
|
if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile &&
|
||||||
v->u.road.state == 254 &&
|
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
||||||
|
|
||||||
DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel);
|
DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel);
|
||||||
|
|
||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
|
@ -598,19 +594,13 @@ static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
|
||||||
|
|
||||||
tile = w->window_number;
|
tile = w->window_number;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Road &&
|
if (v->type == VEH_Road && v->u.road.state == 254 && v->tile == tile &&
|
||||||
v->u.road.state == 254 &&
|
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
--pos < 0) {
|
--pos < 0) {
|
||||||
*veh = v;
|
*veh = v;
|
||||||
if (xm >= 24)
|
if (xm >= 24) return 0;
|
||||||
return 0;
|
if (xm <= 16) return -1; /* show window */
|
||||||
|
return -2; /* start stop */
|
||||||
if (xm <= 16)
|
}
|
||||||
return -1; /* show window */
|
|
||||||
|
|
||||||
return -2; /* start stop */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1; /* outside */
|
return 1; /* outside */
|
||||||
|
|
26
ship_gui.c
26
ship_gui.c
|
@ -616,9 +616,8 @@ static void DrawShipDepotWindow(Window *w)
|
||||||
/* determine amount of items for scroller */
|
/* determine amount of items for scroller */
|
||||||
num = 0;
|
num = 0;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Ship && v->u.ship.state == 0x80 &&
|
if (v->type == VEH_Ship && v->u.ship.state == 0x80 && v->tile == tile)
|
||||||
v->tile == (TileIndex)tile)
|
num++;
|
||||||
num++;
|
|
||||||
}
|
}
|
||||||
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
|
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;
|
num = w->vscroll.pos * w->hscroll.cap;
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Ship &&
|
if (v->type == VEH_Ship && v->u.ship.state == 0x80 && v->tile == tile &&
|
||||||
v->u.ship.state == 0x80 &&
|
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
--num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
|
||||||
|
|
||||||
DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel);
|
DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel);
|
||||||
|
|
||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
|
@ -675,17 +671,13 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh)
|
||||||
|
|
||||||
tile = w->window_number;
|
tile = w->window_number;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Ship &&
|
if (v->type == VEH_Ship && v->vehstatus & VS_HIDDEN && v->tile == tile &&
|
||||||
v->vehstatus&VS_HIDDEN &&
|
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
--pos < 0) {
|
--pos < 0) {
|
||||||
*veh = v;
|
*veh = v;
|
||||||
if (xm >= 19)
|
if (xm >= 19) return 0;
|
||||||
return 0;
|
if (ym <= 10) return -1; /* show window */
|
||||||
if (ym <= 10)
|
return -2; /* start stop */
|
||||||
return -1; /* show window */
|
}
|
||||||
return -2; /* start stop */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1; /* outside */
|
return 1; /* outside */
|
||||||
|
|
|
@ -445,7 +445,7 @@ static int32 CmdBuildRailWagon(uint engine, TileIndex tile, uint32 flags)
|
||||||
u = NULL;
|
u = NULL;
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(w) {
|
FOR_ALL_VEHICLES(w) {
|
||||||
if (w->type == VEH_Train && w->tile == (TileIndex)tile &&
|
if (w->type == VEH_Train && w->tile == tile &&
|
||||||
w->subtype == TS_Free_Car && w->engine_type == engine) {
|
w->subtype == TS_Free_Car && w->engine_type == engine) {
|
||||||
u = GetLastVehicleInChain(w);
|
u = GetLastVehicleInChain(w);
|
||||||
break;
|
break;
|
||||||
|
@ -457,7 +457,7 @@ static int32 CmdBuildRailWagon(uint engine, TileIndex tile, uint32 flags)
|
||||||
dir = _map5[tile] & 3;
|
dir = _map5[tile] & 3;
|
||||||
|
|
||||||
v->direction = (byte)(dir*2+1);
|
v->direction = (byte)(dir*2+1);
|
||||||
v->tile = (TileIndex)tile;
|
v->tile = tile;
|
||||||
|
|
||||||
x = TileX(tile) * TILE_SIZE | _vehicle_initial_x_fract[dir];
|
x = TileX(tile) * TILE_SIZE | _vehicle_initial_x_fract[dir];
|
||||||
y = TileY(tile) * TILE_SIZE | _vehicle_initial_y_fract[dir];
|
y = TileY(tile) * TILE_SIZE | _vehicle_initial_y_fract[dir];
|
||||||
|
@ -633,7 +633,7 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
dir = _map5[tile] & 3;
|
dir = _map5[tile] & 3;
|
||||||
|
|
||||||
v->direction = (byte)(dir*2+1);
|
v->direction = (byte)(dir*2+1);
|
||||||
v->tile = (TileIndex)tile;
|
v->tile = tile;
|
||||||
v->owner = _current_player;
|
v->owner = _current_player;
|
||||||
v->x_pos = (x |= _vehicle_initial_x_fract[dir]);
|
v->x_pos = (x |= _vehicle_initial_x_fract[dir]);
|
||||||
v->y_pos = (y |= _vehicle_initial_y_fract[dir]);
|
v->y_pos = (y |= _vehicle_initial_y_fract[dir]);
|
||||||
|
|
34
train_gui.c
34
train_gui.c
|
@ -370,17 +370,17 @@ static void DrawTrainDepotWindow(Window *w)
|
||||||
hnum = 1;
|
hnum = 1;
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Train &&
|
if (v->type == VEH_Train &&
|
||||||
(v->subtype == TS_Front_Engine || v->subtype == TS_Free_Car) &&
|
(v->subtype == TS_Front_Engine || v->subtype == TS_Free_Car) &&
|
||||||
v->tile == (TileIndex)tile &&
|
v->tile == tile &&
|
||||||
v->u.rail.track == 0x80) {
|
v->u.rail.track == 0x80) {
|
||||||
num++;
|
num++;
|
||||||
// determine number of items in the X direction.
|
// determine number of items in the X direction.
|
||||||
if (v->subtype == TS_Front_Engine) {
|
if (v->subtype == TS_Front_Engine) {
|
||||||
i = 0;
|
i = 0;
|
||||||
u = v;
|
u = v;
|
||||||
do i++; while ( (u=u->next) != NULL);
|
do i++; while ((u = u->next) != NULL);
|
||||||
if (i > hnum) hnum = i;
|
if (i > hnum) hnum = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,12 +403,9 @@ static void DrawTrainDepotWindow(Window *w)
|
||||||
|
|
||||||
// draw all trains
|
// draw all trains
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Train &&
|
if (v->type == VEH_Train && v->subtype == TS_Front_Engine &&
|
||||||
v->subtype == TS_Front_Engine &&
|
v->tile == tile && v->u.rail.track == 0x80 &&
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
v->u.rail.track == 0x80 &&
|
|
||||||
--num < 0 && num >= -w->vscroll.cap) {
|
--num < 0 && num >= -w->vscroll.cap) {
|
||||||
|
|
||||||
DrawTrainImage(v, x+21, y, w->hscroll.cap, w->hscroll.pos, WP(w,traindepot_d).sel);
|
DrawTrainImage(v, x+21, y, w->hscroll.cap, w->hscroll.pos, WP(w,traindepot_d).sel);
|
||||||
/* Draw the train number */
|
/* Draw the train number */
|
||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
|
@ -433,12 +430,9 @@ static void DrawTrainDepotWindow(Window *w)
|
||||||
|
|
||||||
// draw all remaining vehicles
|
// draw all remaining vehicles
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type == VEH_Train &&
|
if (v->type == VEH_Train && v->subtype == TS_Free_Car &&
|
||||||
v->subtype == TS_Free_Car &&
|
v->tile == tile && v->u.rail.track == 0x80 &&
|
||||||
v->tile == (TileIndex)tile &&
|
|
||||||
v->u.rail.track == 0x80 &&
|
|
||||||
--num < 0 && num >= -w->vscroll.cap) {
|
--num < 0 && num >= -w->vscroll.cap) {
|
||||||
|
|
||||||
DrawTrainImage(v, x+50, y, w->hscroll.cap - 1, 0, WP(w,traindepot_d).sel);
|
DrawTrainImage(v, x+50, y, w->hscroll.cap - 1, 0, WP(w,traindepot_d).sel);
|
||||||
DrawString(x, y+2, STR_8816, 0);
|
DrawString(x, y+2, STR_8816, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue