summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-29 18:22:07 +0000
committerdarkvater <darkvater@openttd.org>2005-01-29 18:22:07 +0000
commit885fd2b15c1ae9a1422f82b8bcdd9d1a287c3aa6 (patch)
tree72c3a90571423bfb20449b90f81cc61640763960
parent2005495bfb426452bd3a1a56eedb1eefbcef3197 (diff)
downloadopenttd-885fd2b15c1ae9a1422f82b8bcdd9d1a287c3aa6.tar.xz
(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
-rw-r--r--ai.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ai.c b/ai.c
index 598ab4d4a..11e7c0cb2 100644
--- a/ai.c
+++ b/ai.c
@@ -1962,7 +1962,7 @@ static inline void AiCheckBuildRailBridgeHere(AiRailFinder *arf, TileIndex tile,
// 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 @@ static inline void AiCheckBuildRoadBridgeHere(AiRoadFinder *arf, TileIndex tile,
// 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) {