summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-04 10:53:36 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-04 10:53:36 +0100
commit80d60fd58fe4fb29eff007bcfce8eaa34c64155b (patch)
tree51f993bdcec316d30ba287d3a68b50c6a211ed4c
parent4d46d4af76973428171df15792d5214ff0ea97b4 (diff)
downloadmaria-80d60fd58fe4fb29eff007bcfce8eaa34c64155b.tar.gz
fix re-entry of supply trains and generals in annexed silesia
-rw-r--r--rules.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 1557a82..24d0f11 100644
--- a/rules.js
+++ b/rules.js
@@ -3286,6 +3286,14 @@ function can_train_re_enter(p) {
)
}
+function all_re_entry_cities_for_supply_train(power) {
+ if (is_intro() && power === P_FRANCE)
+ return all_home_country_major_fortresses[P_BAVARIA]
+ if (power === P_PRUSSIA && has_prussia_annexed_silesia())
+ return all_prussian_and_silesian_major_fortresses
+ return all_home_country_major_fortresses[power]
+}
+
function has_re_entry_space_for_supply_train(pow) {
if (can_re_enter_train_at_power_fortress(pow))
return true
@@ -3296,7 +3304,7 @@ function has_re_entry_space_for_supply_train(pow) {
}
function gen_re_enter_train_at_power_fortress(pow) {
- for (let s of all_home_country_major_fortresses[pow]) {
+ for (let s of all_re_entry_cities_for_supply_train(pow)) {
if (is_intro() && is_flanders_space(s))
continue
if (is_friendly_controlled_fortress(s) && !has_any_piece(s))
@@ -3305,7 +3313,7 @@ function gen_re_enter_train_at_power_fortress(pow) {
}
function can_re_enter_train_at_power_fortress(pow) {
- for (let s of all_home_country_major_fortresses[pow]) {
+ for (let s of all_re_entry_cities_for_supply_train(pow)) {
if (is_intro() && is_flanders_space(s))
continue
if (is_friendly_controlled_fortress(s) && !has_any_piece(s))
@@ -3528,6 +3536,8 @@ function goto_recruit() {
function all_re_entry_cities_for_general(p) {
if (is_intro() && piece_power[p] === P_FRANCE)
return all_home_country_major_fortresses[P_BAVARIA]
+ if (piece_power[p] === P_PRUSSIA && has_prussia_annexed_silesia())
+ return all_prussian_and_silesian_major_fortresses()
if (p === ARENBERG)
return all_arenberg_major_fortresses
return all_home_country_major_fortresses[game.power]