mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(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
This commit is contained in:
parent
d2f28208cc
commit
b8fb0141a3
4
ai.c
4
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user