diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 1 | ||||
-rw-r--r-- | src/station.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index c7e4f5fbc..c00faa18c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -275,6 +275,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v /* If tile test is not successful, get one tile up, * ready for a test in first circle around center tile */ *tile = TileAddByDir(*tile, DIR_N); + if (size / 2 == 0) return false; return CircularTileSearch(tile, size / 2, 1, 1, proc, user_data); } else { return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data); diff --git a/src/station.cpp b/src/station.cpp index 1266de7f2..fac559e5f 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -366,8 +366,8 @@ void Station::RecomputeIndustriesNear() /* Охватываем верхнюю территорию */ TileIndex start_tile = TopTile(this->xy); uint max_radius = max( - max(DistanceManhattan(start_tile, TileXY(riv.rect.left, riv.rect.top)), DistanceManhattan(start_tile, TileXY(riv.rect.left, riv.rect.bottom))), - max(DistanceManhattan(start_tile, TileXY(riv.rect.right, riv.rect.top)), DistanceManhattan(start_tile, TileXY(riv.rect.right, riv.rect.bottom))) + max(DistanceManhattan(start_tile, TopTile(TileXY(riv.rect.left, riv.rect.top))), DistanceManhattan(start_tile, TopTile(TileXY(riv.rect.left, riv.rect.bottom)))), + max(DistanceManhattan(start_tile, TopTile(TileXY(riv.rect.right, riv.rect.top))), DistanceManhattan(start_tile, TopTile(TileXY(riv.rect.right, riv.rect.bottom)))) ); CircularTileSearch(&start_tile, 2 * max_radius + 1, &FindIndustryToDeliver, &riv); |