From d059b9babc8e92b272fbf11d3801a47313a02d07 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 20 Mar 2025 01:35:43 +0100 Subject: possible fix for get_fronts_to_add_to ("not" as single front) --- rules.js | 4 ++-- rules.ts | 6 ++---- 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) { -- cgit v1.2.3