summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 7b5d704..0b68ade 100644
--- a/rules.js
+++ b/rules.js
@@ -2442,6 +2442,19 @@ function goto_combat_round(new_combat_round) {
let was_contested = is_contested_battle_field()
+ // If a relief force attacks besieging forces outside a castle,
+ // but the besieged forces sail away and abandon the castle,
+ // skip the first combat round to let the battle proceed from
+ // when the reserves arrive.
+ if (game.combat_round === 1 && !is_under_siege(game.where)) {
+ if (!was_contested && is_contested_town(game.where)) {
+ if (count_friendly_in_field_excluding_reserves(game.where) === 0) {
+ log("Combat round skipped because main attack sailed away.")
+ game.combat_round = 2
+ }
+ }
+ }
+
// If the main attack regroups away from a new siege while reinforcements
// are on the way, we need to skip the first combat round.
if (game.combat_round === 1 && is_under_siege(game.where)) {