From 4c9e0a4d7c5575157f8b7151ec0a8b6745e7f9d2 Mon Sep 17 00:00:00 2001 From: teisuru <31881306+teisuru@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:37:10 +0100 Subject: fix battle losses fix battle losses when no friendly unit has routed --- rules.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rules.js b/rules.js index 3cd079f..d4bd57c 100644 --- a/rules.js +++ b/rules.js @@ -9695,6 +9695,7 @@ function action_losses(lord, type) { states.battle_losses = { inactive: "Losses", prompt() { + let done = true view.prompt = "Losses: Determine the fate of your Routed units." for (let lord = first_friendly_lord; lord <= last_friendly_lord; ++lord) { if (is_lord_on_map(lord) && lord_has_routed_troops(lord)) { @@ -9708,8 +9709,12 @@ states.battle_losses = { gen_action_routed_men_at_arms(lord) if (get_lord_routed_forces(lord, MILITIA) > 0) gen_action_routed_militia(lord) + done = false } } + if (done) { + view.actions.done = 1 + } }, routed_mercenaries(lord) { action_losses(lord, MERCENARIES) @@ -9726,6 +9731,9 @@ states.battle_losses = { routed_militia(lord) { action_losses(lord, MILITIA) }, + done() { + goto_death_or_disband() + }, } // === ENDING THE BATTLE: SPOILS (VICTOR) === -- cgit v1.2.3