town_cmd.c
changeset 2635 88b8b74c01ac
parent 2630 35249d2ded3e
child 2637 8807e6a63f89
--- a/town_cmd.c	Sun Nov 13 21:16:34 2005 +0000
+++ b/town_cmd.c	Mon Nov 14 08:09:57 2005 +0000
@@ -97,7 +97,7 @@
 	{
 		/* this "randomizes" on the (up to) 4 variants of a building */
 		byte gfx   = _m[ti->tile].m4;
-		byte stage = _m[ti->tile].m3 >> 6;
+		byte stage = GB(_m[ti->tile].m3, 6, 2);
 		uint variant;
 		variant  = ti->x >> 4;
 		variant ^= ti->x >> 6;
@@ -635,7 +635,7 @@
 
 		// Possibly extend the road in a direction.
 		// Randomize a direction and if it has a road, bail out.
-		i = (int)Random() & 3;
+		i = GB(Random(), 0, 2);
 		if (HASBIT(mask, i))
 			return;