summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-23 11:56:54 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-23 11:56:54 +0200
commit64ce021aa5567937f06ce8df350368b32faacdec (patch)
tree76b1281ff085718c5caf7c6a5f71a21ce7a4f1bd
parent7012e86d0baabf06967d4b2fd3ffb6ebd78ca827 (diff)
downloadfriedrich-64ce021aa5567937f06ce8df350368b32faacdec.tar.gz
fix austrian victory check with OO (incorrect check for saxony objective)HEADmaster
-rw-r--r--rules.js4
1 files changed, 3 insertions, 1 deletions
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
}