summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 947f71a..bd820ab 100644
--- a/rules.js
+++ b/rules.js
@@ -1864,6 +1864,7 @@ function capture_enemy_fortress(s) {
function recapture_french_fortress(s) {
log(`France recaptured fortress at %${s}.`)
+ set_all_pieces_outside(s)
set_delete(game.british.fortresses, s)
set_add(game.french.fortresses, s)
award_french_vp(3)
@@ -1871,6 +1872,7 @@ function recapture_french_fortress(s) {
function recapture_british_fortress(s) {
log(`Britain recaptured fortress at %${s}.`)
+ set_all_pieces_outside(s)
set_delete(game.french.fortresses, s)
set_add(game.british.fortresses, s)
award_british_vp(3)
@@ -1921,14 +1923,18 @@ function is_fort_or_fortress_vacant_of_besieging_units(s) {
return !has_french_units(s)
}
+function set_all_pieces_outside(s) {
+ for (let p = 1; p <= last_piece; ++p)
+ if (is_piece_in_space(p, s))
+ set_piece_outside(p)
+}
+
function lift_sieges_and_amphib() {
// Lift sieges
for_each_siege(s => {
if (is_fort_or_fortress_vacant_of_besieging_units(s)) {
log(`Lifted siege at %${s}.`)
- for (let p = 1; p <= last_piece; ++p)
- if (is_piece_in_space(p, s))
- set_piece_outside(p)
+ set_all_pieces_outside(s)
delete game.sieges[s]
}
})