mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1328) Turn loop with explicit terminator element into loop using endof()
This commit is contained in:
parent
ae336f146d
commit
09dd8053a9
|
@ -170,14 +170,12 @@ static int CountMapSquareAround(uint tile, byte type, byte min, byte max) {
|
|||
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
|
||||
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
|
||||
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
|
||||
0,
|
||||
};
|
||||
int j;
|
||||
const TileIndexDiff *p = _count_square_table;
|
||||
const TileIndexDiff *p;
|
||||
int num = 0;
|
||||
|
||||
while ( (j=*p++) != 0 ) {
|
||||
tile = TILE_MASK(tile + j);
|
||||
for (p = _count_square_table; p != endof(_count_square_table); ++p) {
|
||||
tile = TILE_MASK(tile + *p);
|
||||
|
||||
if (IS_TILETYPE(tile, type) && _map5[tile] >= min && _map5[tile] <= max)
|
||||
num++;
|
||||
|
|
Loading…
Reference in New Issue