From 64ce021aa5567937f06ce8df350368b32faacdec Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 23 Aug 2024 11:56:54 +0200 Subject: fix austrian victory check with OO (incorrect check for saxony objective) --- rules.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 47b62d3..5a7cf75 100644 --- a/rules.js +++ b/rules.js @@ -414,6 +414,8 @@ const full_objective = [ set_union(primary_objective[6], secondary_objective[6]), ] +const austrian_saxony_objectives = set_intersect(full_objective[P_AUSTRIA], data.country.Saxony) + function make_protect(power, country) { for (let s of all_objectives) if (set_has(country, s)) @@ -954,7 +956,7 @@ function check_offensive_option_victory() { function check_power_victory(victory, city_list, power) { if (power === P_AUSTRIA && is_offensive_option()) { let n = count_captured_objectives(power) - if (n >= city_list[power].length - 4 && has_conquered_one_of(data.country.Saxony)) + if (n >= city_list[power].length - 4 && has_conquered_one_of(austrian_saxony_objectives)) set_add(victory, power) return } -- cgit v1.2.3