summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-04 18:20:25 +0100
committerTor Andersson <tor@ccxvii.net>2022-12-04 18:20:25 +0100
commitba0991afac893f64458ec7e548ffc8946508dda0 (patch)
treeae61d09d2735712a8e41ed0399609cc4546f6acb
parent51a0d654120adbed513ca4eb0743313eaa97551e (diff)
downloadhammer-of-the-scots-ba0991afac893f64458ec7e548ffc8946508dda0.tar.gz
Remove blocks from reserve list when the battle ends.
In case a defection battle ends early, if there are blocks still in reserve they would not be able to move properly during the normal turn.
-rw-r--r--rules.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 3832b57..c11d22a 100644
--- a/rules.js
+++ b/rules.js
@@ -482,6 +482,8 @@ function can_block_move_to(who, from, to) {
}
function can_block_move(who) {
+ if (!is_on_map(who))
+ return false
if (who === B_NORSE)
return false
if (block_owner(who) === game.active && !set_has(game.moved, who)) {
@@ -1667,6 +1669,8 @@ function start_battle(where, reason) {
function end_battle() {
print_retreat_summary()
+ bring_on_reserves()
+
game.flash = ""
game.battle_round = 0
reset_border_limits()