1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +01:00

Codechange: Add SpiralTileSequence to iterate over a tile area the same ways as CircularTileSearch.

This commit is contained in:
frosch
2025-04-18 22:48:18 +02:00
committed by frosch
parent b9bd7b2cfe
commit 0dada5a750
5 changed files with 354 additions and 0 deletions

View File

@@ -249,6 +249,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v
/* If the length of the side is uneven, the center has to be checked
* separately, as the pattern of uneven sides requires to go around the center */
if (proc(*tile, user_data)) return true;
if (size < 2) return false;
/* If tile test is not successful, get one tile up,
* ready for a test in first circle around center tile */