summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-27 16:55:19 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commita22eb4ab7c82d41b44da9d646776a08b87ca636c (patch)
tree59f4baf05e84c7801743e316a0af153b19e31829
parent3cd960930b75a45acdc331fa1b97639d96e4a777 (diff)
downloadfriedrich-a22eb4ab7c82d41b44da9d646776a08b87ca636c.tar.gz
log actual number of troops lost
-rw-r--r--rules.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 5afbba0..942a1df 100644
--- a/rules.js
+++ b/rules.js
@@ -2416,15 +2416,14 @@ function remove_stack_from_combat(s) {
}
function goto_retreat() {
- let hits = Math.abs(game.count)
+ let lost = Math.abs(game.count)
+ let hits = lost
let loser = get_loser()
// no more fighting for the loser
remove_stack_from_combat(loser)
- log("P" + get_supreme_commander(loser) + " lost " + hits + " troops.")
-
// apply hits
for (let i = game.selected.length - 1; i >= 0 && hits > 0; --i) {
let p = game.selected[i]
@@ -2442,6 +2441,8 @@ function goto_retreat() {
}
}
+ log("P" + get_supreme_commander(loser) + " lost " + (lost-hits) + " troops")
+
resume_retreat()
}