town_cmd.c
changeset 2635 7ed07303448d
parent 2630 7206058a7e82
child 2637 722dae65c4a8
equal deleted inserted replaced
2634:0df9396b0067 2635:7ed07303448d
    95 
    95 
    96 	/* Retrieve pointer to the draw town tile struct */
    96 	/* Retrieve pointer to the draw town tile struct */
    97 	{
    97 	{
    98 		/* this "randomizes" on the (up to) 4 variants of a building */
    98 		/* this "randomizes" on the (up to) 4 variants of a building */
    99 		byte gfx   = _m[ti->tile].m4;
    99 		byte gfx   = _m[ti->tile].m4;
   100 		byte stage = _m[ti->tile].m3 >> 6;
   100 		byte stage = GB(_m[ti->tile].m3, 6, 2);
   101 		uint variant;
   101 		uint variant;
   102 		variant  = ti->x >> 4;
   102 		variant  = ti->x >> 4;
   103 		variant ^= ti->x >> 6;
   103 		variant ^= ti->x >> 6;
   104 		variant ^= ti->y >> 4;
   104 		variant ^= ti->y >> 4;
   105 		variant -= ti->y >> 6;
   105 		variant -= ti->y >> 6;
   633 		if (IsTileType(tile, MP_TUNNELBRIDGE))
   633 		if (IsTileType(tile, MP_TUNNELBRIDGE))
   634 			return;
   634 			return;
   635 
   635 
   636 		// Possibly extend the road in a direction.
   636 		// Possibly extend the road in a direction.
   637 		// Randomize a direction and if it has a road, bail out.
   637 		// Randomize a direction and if it has a road, bail out.
   638 		i = (int)Random() & 3;
   638 		i = GB(Random(), 0, 2);
   639 		if (HASBIT(mask, i))
   639 		if (HASBIT(mask, i))
   640 			return;
   640 			return;
   641 
   641 
   642 		// This is the tile we will reach if we extend to this direction.
   642 		// This is the tile we will reach if we extend to this direction.
   643 		tmptile = TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[i]));
   643 		tmptile = TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[i]));