diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-05 15:13:50 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 19:05:52 +0200 |
commit | 593a5fb24156af994ab0a37b5bd3dc13a99c8e78 (patch) | |
tree | 7f23572511ea2916dec2b98a50c98ee22fcb50b3 /play.js | |
parent | 01e1c6cea648be6807caf89f19ac56d8278b8d28 (diff) | |
download | time-of-crisis-593a5fb24156af994ab0a37b5bd3dc13a99c8e78.tar.gz |
Don't battle twice with Militia.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1273,6 +1273,9 @@ function on_update() { lone_militia = false } } + // militia that already battled is not part of attacker stack + if (view.combat_region === region && view.combat.attacker >= 0 && !view.combat.militia) + lone_militia = true if (lone_militia) { if (is_battle_stack(region, "militia", region)) { if (has_militia_castra(region)) @@ -1343,8 +1346,13 @@ function on_update() { } } - if (has_militia(region) && inside) - stack.push(ui.militia[region]) + if (has_militia(region) && inside) { + // militia that already battled is not part of attacker stack + if (view.combat_region === region && view.combat.attacker >= 0 && !view.combat.militia) + ; + else + stack.push(ui.militia[region]) + } if (is_battle_stack(region, "general", pi * 6 + ai)) layout_battle_stack(pi * 6 + ai === view.combat.attacker, stack, region) |