diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-03-20 01:35:43 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-03-20 01:35:43 +0100 |
commit | d059b9babc8e92b272fbf11d3801a47313a02d07 (patch) | |
tree | 16564347bf275bced03754c5811ce9040ab127d6 | |
parent | 8a16b5eb275a96d9e0dfa8d37a04969b49e319f2 (diff) | |
download | land-and-freedom-d059b9babc8e92b272fbf11d3801a47313a02d07.tar.gz |
possible fix for get_fronts_to_add_to ("not" as single front)
-rw-r--r-- | rules.js | 4 | ||||
-rw-r--r-- | rules.ts | 6 |
2 files changed, 4 insertions, 6 deletions
@@ -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); @@ -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) { |