(svn r1720) - Fix: signed/unsigned warnings. Tile which is incremented/decremented every time until suitable ground is found is compared to the direction it is going in. If this wraps, return error. For this treat the tile itself as a TileIndexDiff
authordarkvater
Sat, 29 Jan 2005 18:22:07 +0000
changeset 1216 ab4d046ee9d7
parent 1215 6c2fe2311e52
child 1217 ab9f02a224ab
(svn r1720) - Fix: signed/unsigned warnings. Tile which is incremented/decremented every time until suitable ground is found is compared to the direction it is going in. If this wraps, return error. For this treat the tile itself as a TileIndexDiff
ai.c
--- a/ai.c	Sat Jan 29 16:47:19 2005 +0000
+++ b/ai.c	Sat Jan 29 18:22:07 2005 +0000
@@ -1962,7 +1962,7 @@
 		// Allow bridges directly over bottom tiles
 		flag = arf->ti.z == 0;
 		for(;;) {
-			if (tile_new < -TileOffsByDir(dir2)) return; // Wraping around map, no bridge possible!
+			if ((TileIndexDiff)tile_new < -TileOffsByDir(dir2)) return; // Wraping around map, no bridge possible!
 			tile_new = TILE_MASK(tile_new + TileOffsByDir(dir2));
 			FindLandscapeHeightByTile(&arf->ti, tile_new);
 			if (arf->ti.tileh != 0 || arf->ti.type == MP_CLEAR || arf->ti.type == MP_TREES) {
@@ -2851,7 +2851,7 @@
 		// Allow bridges directly over bottom tiles
 		flag = arf->ti.z == 0;
 		for(;;) {
-			if (tile_new < -TileOffsByDir(dir2)) return; // Wraping around map, no bridge possible!
+			if ((TileIndexDiff)tile_new < -TileOffsByDir(dir2)) return; // Wraping around map, no bridge possible!
 			tile_new = TILE_MASK(tile_new + TileOffsByDir(dir2));
 			FindLandscapeHeightByTile(&arf->ti, tile_new);
 			if (arf->ti.tileh != 0 || arf->ti.type == MP_CLEAR || arf->ti.type == MP_TREES) {