src/map.cpp
changeset 7868 25b9aad39e4a
parent 7036 9f23930e7ded
child 7901 1af11255e634
equal deleted inserted replaced
7867:07a2830337ce 7868:25b9aad39e4a
   280 		/* If the length of the side is uneven, the center has to be checked
   280 		/* If the length of the side is uneven, the center has to be checked
   281 		 * separately, as the pattern of uneven sides requires to go around the center */
   281 		 * separately, as the pattern of uneven sides requires to go around the center */
   282 		n = 2;
   282 		n = 2;
   283 		if (proc(TileXY(x, y), data)) return true;
   283 		if (proc(TileXY(x, y), data)) return true;
   284 
   284 
   285 		/* If tile test is not successfull, get one tile down and left,
   285 		/* If tile test is not successful, get one tile down and left,
   286 		 * ready for a test in first circle around center tile */
   286 		 * ready for a test in first circle around center tile */
   287 		x += _tileoffs_by_dir[DIR_W].x;
   287 		x += _tileoffs_by_dir[DIR_W].x;
   288 		y += _tileoffs_by_dir[DIR_W].y;
   288 		y += _tileoffs_by_dir[DIR_W].y;
   289 	} else {
   289 	} else {
   290 		n = 1;
   290 		n = 1;
   298 	for (; n < size; n += 2) {
   298 	for (; n < size; n += 2) {
   299 		for (dir = DIAGDIR_NE; dir < DIAGDIR_END; dir++) {
   299 		for (dir = DIAGDIR_NE; dir < DIAGDIR_END; dir++) {
   300 			uint j;
   300 			uint j;
   301 			for (j = n; j != 0; j--) {
   301 			for (j = n; j != 0; j--) {
   302 				if (x <= MapMaxX() && y <= MapMaxY() && ///< Is the tile within the map?
   302 				if (x <= MapMaxX() && y <= MapMaxY() && ///< Is the tile within the map?
   303 						proc(TileXY(x, y), data)) {     ///< Is the callback successfulll?
   303 						proc(TileXY(x, y), data)) {     ///< Is the callback successful?
   304 					return true;                        ///< then stop the search
   304 					return true;                        ///< then stop the search
   305 				}
   305 				}
   306 
   306 
   307 				/* Step to the next 'neighbour' in the circular line */
   307 				/* Step to the next 'neighbour' in the circular line */
   308 				x += _tileoffs_by_diagdir[dir].x;
   308 				x += _tileoffs_by_diagdir[dir].x;