summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-05 21:51:13 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-07 15:56:29 +0200
commitbe34836e93d0456b6d1651386260c188bb2f7e4c (patch)
treed59fe2c51909e41b325b8acefb2a8e85c9a40c6a
parent9fc7a4ba2f4da39bfe1df6f88c4b42578f0c53cf (diff)
downloadhammer-of-the-scots-master.tar.gz
Reset border limit display at start of winter.HEADmaster
-rw-r--r--rules.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 716c1fd..319f1a0 100644
--- a/rules.js
+++ b/rules.js
@@ -411,6 +411,10 @@ function reset_border_limits() {
game.border_limit.length = 0
}
+function reset_border_last_used() {
+ game.last_used.length = 0
+}
+
function count_friendly(where) {
let p = game.active
let count = 0
@@ -877,7 +881,7 @@ function start_game_turn() {
// Reset movement and attack tracking state
game.truce = false
reset_border_limits()
- game.last_used = []
+ reset_border_last_used()
game.attacker = []
game.reserves = []
game.moved = []
@@ -2196,15 +2200,15 @@ states.regroup = {
delete game.battle_active
if (game.battle_reason === 'herald') {
delete game.battle_reason
- game.last_used = []
+ reset_border_last_used()
end_player_turn()
} else if (game.battle_reason === 'pillage') {
delete game.battle_reason
- game.last_used = []
+ reset_border_last_used()
end_player_turn()
} else if (game.battle_reason === 'coronation') {
delete game.battle_reason
- game.last_used = []
+ reset_border_last_used()
resume_coronation()
} else {
delete game.battle_reason
@@ -2296,6 +2300,8 @@ function goto_winter_turn() {
log("")
log(".h1 Winter of " + game.year)
log("")
+ reset_border_limits()
+ reset_border_last_used()
english_nobles_go_home()
}