From 39f5dbfd3b22f24120c63c09433415cdde023bc6 Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 5 Oct 2005 07:20:26 +0000 Subject: (svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB --- roadveh_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'roadveh_cmd.c') diff --git a/roadveh_cmd.c b/roadveh_cmd.c index ee882b25c..9a5cc09f3 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -284,7 +284,7 @@ static bool EnumRoadSignalFindDepot(TileIndex tile, RoadFindDepotData *rfdd, int tile += TileOffsByDir(_road_pf_directions[track]); if (IsTileType(tile, MP_STREET) && - (_m[tile].m5 & 0xF0) == 0x20 && + GB(_m[tile].m5, 4, 4) == 2 && IsTileOwner(tile, rfdd->owner)) { if (length < rfdd->best_length) { @@ -1034,7 +1034,7 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir) } if (IsTileType(tile, MP_STREET)) { - if ((_m[tile].m5&0xF0) == 0x20 && IsTileOwner(tile, v->owner)) + if (GB(_m[tile].m5, 4, 4) == 2 && IsTileOwner(tile, v->owner)) /* Road crossing */ bitmask |= _road_veh_fp_ax_or[_m[tile].m5&3]; } else if (IsTileType(tile, MP_STATION)) { @@ -1237,7 +1237,7 @@ static void RoadVehController(Vehicle *v) v->cur_speed = 0; - dir = _m[v->tile].m5&3; + dir = GB(_m[v->tile].m5, 0, 2); v->direction = dir*2+1; rd2 = _roadveh_data_2[dir]; @@ -1286,7 +1286,7 @@ static void RoadVehController(Vehicle *v) } if (IsTileType(gp.new_tile, MP_TUNNELBRIDGE) && - (_m[gp.new_tile].m5&0xF0) == 0 && + GB(_m[gp.new_tile].m5, 4, 4) == 0 && (VehicleEnterTile(v, gp.new_tile, gp.x, gp.y)&4)) { //new_dir = RoadGetNewDirection(v, gp.x, gp.y) -- cgit v1.2.3-54-g00ecf