summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-17 17:59:33 +0200
committerTor Andersson <tor@ccxvii.net>2023-06-17 17:59:33 +0200
commit7a99a95a616a73073982e2432b49f57c23135859 (patch)
treec19cd977afb93c1eeb4f562819eeb1ba9abc8319
parent1e6018b24492836e45876fb74955c85f0576a088 (diff)
downloadwilderness-war-7a99a95a616a73073982e2432b49f57c23135859.tar.gz
Fix bugs involving Intercept + Avoid Battle interactions.
The limitation on avoiding after intercepting does not apply to leaders. Fix bug with picking up units that attempted an intercept for avoiding.
-rw-r--r--rules.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 246a587..b7de0e4 100644
--- a/rules.js
+++ b/rules.js
@@ -2593,7 +2593,7 @@ states.designate_force = {
// pick up units
for_each_friendly_unit_in_node(where, p => {
- if (game.force.reason === 'avoid' && is_piece_inside(p))
+ if (game.force.reason === 'avoid' && (is_piece_inside(p) || did_piece_intercept(p)))
return // continue
if (is_british_iroquois_or_mohawk(p)) {
// 5.534 Only Johnson can command British Iroquois and Mohawk (and for free)
@@ -3908,7 +3908,8 @@ function attempt_intercept() {
let who = intercepting_piece()
if (is_leader(who)) {
for_each_piece_in_force(who, p => {
- game.move.intercepted.push(p)
+ if (is_unit(p))
+ game.move.intercepted.push(p)
})
} else {
game.move.intercepted.push(who)
@@ -4009,7 +4010,7 @@ states.designate_inside = {
function goto_avoid_battle() {
let from = moving_piece_space()
- if (has_unbesieged_enemy_units(from)) {
+ if (has_unbesieged_enemy_units_that_did_not_intercept(from)) {
if (!game.move.did_attempt_intercept) {
if (can_enemy_avoid_battle(from)) {
game.move.avoiding = 0