From cadc1dcca1b350672e340f3aee79f5c98df00d92 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 Sep 2022 21:50:01 +0200 Subject: Fix "within 2 of" list creation. --- rules.js | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/rules.js b/rules.js index 8cd4b9c..87b4763 100644 --- a/rules.js +++ b/rules.js @@ -676,14 +676,10 @@ define_indian("gray", SHAWIANGTO, "Tuscarora") const within_two_of_canajoharie = [ CANAJOHARIE ] for_each_exit(CANAJOHARIE, one => { - if (!set_has(within_two_of_canajoharie, one)) { - set_add(within_two_of_canajoharie, one) - for_each_exit(one, two => { - if (!set_has(within_two_of_canajoharie, two)) { - set_add(within_two_of_canajoharie, two) - } - }) - } + set_add(within_two_of_canajoharie, one) + for_each_exit(one, two => { + set_add(within_two_of_canajoharie, two) + }) }) const within_two_of_gray_settlement = [] @@ -692,14 +688,10 @@ indians.spaces_from_color.gray.forEach(zero => { }) indians.spaces_from_color.gray.forEach(zero => { for_each_exit(zero, one => { - if (!set_has(within_two_of_gray_settlement, one)) { - set_add(within_two_of_gray_settlement, one) - for_each_exit(one, two => { - if (!set_has(within_two_of_gray_settlement, two)) { - set_add(within_two_of_gray_settlement, two) - } - }) - } + set_add(within_two_of_gray_settlement, one) + for_each_exit(one, two => { + set_add(within_two_of_gray_settlement, two) + }) }) }) -- cgit v1.2.3