ai/trolly/trolly.c
changeset 2635 7ed07303448d
parent 2549 5587f9a38563
child 2682 7fa4b202b9f0
--- a/ai/trolly/trolly.c	Sun Nov 13 21:16:34 2005 +0000
+++ b/ai/trolly/trolly.c	Mon Nov 14 08:09:57 2005 +0000
@@ -781,7 +781,8 @@
 	// To make the depot stand in the middle of the route, we start from the center..
 	// But first we walk through the route see if we can find a depot that is ours
 	//  this keeps things nice ;)
-	int g, i, j, r;
+	int g, i, r;
+	uint j;
 	TileIndex tile;
 	assert(p->ainew.state == AI_STATE_FIND_DEPOT);
 
@@ -796,7 +797,7 @@
 					// We found a depot, is it ours? (TELL ME!!!)
 					if (IsTileOwner(tile + TileOffsByDir(j), _current_player)) {
 						// Now, is it pointing to the right direction.........
-						if ((_m[tile + TileOffsByDir(j)].m5 & 3) == (j ^ 2)) {
+						if (GB(_m[tile + TileOffsByDir(j)].m5, 0, 2) == (j ^ 2)) {
 							// Yeah!!!
 							p->ainew.depot_tile = tile + TileOffsByDir(j);
 							p->ainew.depot_direction = j ^ 2; // Reverse direction