Fix (or unfix) the search radius for orange buttons
This commit is contained in:
parent
1481047b94
commit
e33c35bbe0
@ -33,9 +33,9 @@ export function* find_terrain_linear(levelish, start_cell, type_names, reverse =
|
|||||||
// Only used by orange buttons.
|
// Only used by orange buttons.
|
||||||
// Yields [tile, cell].
|
// Yields [tile, cell].
|
||||||
export function* find_terrain_diamond(levelish, start_cell, type_names) {
|
export function* find_terrain_diamond(levelish, start_cell, type_names) {
|
||||||
let max_search_radius = (
|
// Note that this won't search the entire level in all cases, but it does match CC2 behavior.
|
||||||
Math.max(start_cell.x, levelish.size_x - start_cell.x) +
|
// Not worth a compat flag since it only affects level design, and fairly perversely
|
||||||
Math.max(start_cell.y, levelish.size_y - start_cell.y));
|
let max_search_radius = Math.max(levelish.size_x, levelish.size_y) + 1;
|
||||||
for (let dist = 1; dist <= max_search_radius; dist++) {
|
for (let dist = 1; dist <= max_search_radius; dist++) {
|
||||||
// Start east and move counterclockwise
|
// Start east and move counterclockwise
|
||||||
let sx = start_cell.x + dist;
|
let sx = start_cell.x + dist;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user