summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-20 01:35:43 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-20 01:35:43 +0100
commitd059b9babc8e92b272fbf11d3801a47313a02d07 (patch)
tree16564347bf275bced03754c5811ce9040ab127d6
parent8a16b5eb275a96d9e0dfa8d37a04969b49e319f2 (diff)
downloadland-and-freedom-d059b9babc8e92b272fbf11d3801a47313a02d07.tar.gz
possible fix for get_fronts_to_add_to ("not" as single front)
-rw-r--r--rules.js4
-rw-r--r--rules.ts6
2 files changed, 4 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 714a227..a66f665 100644
--- a/rules.js
+++ b/rules.js
@@ -2355,12 +2355,12 @@ function resolve_final_bid() {
}
resolve_active_and_proceed();
}
-function get_fronts_to_add_to(target, not = []) {
+function get_fronts_to_add_to(target, not) {
if (target === data_1.CLOSEST_TO_DEFEAT || target === data_1.CLOSEST_TO_VICTORY) {
return get_fronts_closest_to(target);
}
else if (target === data_1.ANY) {
- return data_1.FRONTS.filter((id) => game.fronts[id].status === null && !not.includes(id));
+ return data_1.FRONTS.filter((id) => game.fronts[id].status === null && id !== not);
}
else if (game.fronts[target].status === data_1.DEFEAT) {
return get_fronts_closest_to(data_1.CLOSEST_TO_DEFEAT);
diff --git a/rules.ts b/rules.ts
index c88b8d7..36efee3 100644
--- a/rules.ts
+++ b/rules.ts
@@ -2928,14 +2928,12 @@ function resolve_final_bid() {
function get_fronts_to_add_to(
target: string | number,
- not: FrontId[] = []
+ not?: FrontId
): FrontId[] {
if (target === CLOSEST_TO_DEFEAT || target === CLOSEST_TO_VICTORY) {
return get_fronts_closest_to(target);
} else if (target === ANY) {
- return FRONTS.filter(
- (id) => game.fronts[id].status === null && !not.includes(id)
- );
+ return FRONTS.filter((id) => game.fronts[id].status === null && id !== not);
} else if (game.fronts[target].status === DEFEAT) {
return get_fronts_closest_to(CLOSEST_TO_DEFEAT);
} else if (game.fronts[target].status === VICTORY) {