diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2024-02-13 16:37:10 +0100 |
---|---|---|
committer | teisuru <31881306+teisuru@users.noreply.github.com> | 2024-02-13 16:37:10 +0100 |
commit | 4c9e0a4d7c5575157f8b7151ec0a8b6745e7f9d2 (patch) | |
tree | 3ed98aef3d2b0dda21196472bbc3cb3204286d60 | |
parent | 17f3a60fa7e2ea91ea285ce99950fd85e61e2669 (diff) | |
download | plantagenet-4c9e0a4d7c5575157f8b7151ec0a8b6745e7f9d2.tar.gz |
fix battle losses
fix battle losses when no friendly unit has routed
-rw-r--r-- | rules.js | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) === |