summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 3c07ae1..08e38c0 100644
--- a/rules.js
+++ b/rules.js
@@ -3003,7 +3003,7 @@ states.select_moves = {
}
if (game.turn_option === 'pass') {
- if (has_mandatory_combats() && (can_group_move || can_regroup_move))
+ if (has_mandatory_withdrawals())
view.actions.end_turn = 0
else
view.actions.end_turn = 1
@@ -3057,15 +3057,15 @@ function list_valid_group_moves() {
function list_valid_withdrawal_group_moves() {
let result = []
let mandatory = false
- if (is_mandatory_combat(BARDIA)) {
+ if (is_mandatory_combat(BARDIA) && is_valid_withdrawal_group_move_from(BARDIA)) {
set_add(result, BARDIA)
mandatory = true
}
- if (is_mandatory_combat(BENGHAZI)) {
+ if (is_mandatory_combat(BENGHAZI) && is_valid_withdrawal_group_move_from(BENGHAZI)) {
set_add(result, BENGHAZI)
mandatory = true
}
- if (is_mandatory_combat(TOBRUK)) {
+ if (is_mandatory_combat(TOBRUK) && is_valid_withdrawal_group_move_from(TOBRUK)) {
set_add(result, TOBRUK)
mandatory = true
}
@@ -4582,6 +4582,14 @@ function has_mandatory_combats() {
return is_mandatory_combat(BARDIA) || is_mandatory_combat(BENGHAZI) || is_mandatory_combat(TOBRUK)
}
+function has_mandatory_withdrawals() {
+ return (
+ (is_mandatory_combat(BARDIA) && is_valid_withdrawal_group_move_from(BARDIA)) ||
+ (is_mandatory_combat(BENGHAZI) && is_valid_withdrawal_group_move_from(BENGHAZI)) ||
+ (is_mandatory_combat(TOBRUK) && is_valid_withdrawal_group_move_from(TOBRUK))
+ )
+}
+
function is_mandatory_combat(fortress) {
if (is_battle_hex(fortress)) {
if (game.phasing === AXIS)