summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-03-21 02:06:04 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commit86ab7f24be74b4c289924f5039a4fb5b46002c3f (patch)
tree1374c636d7fc3aed236cc7ad0ccb9b4872821105 /rules.js
parent9c68a47171603a584b2ed2a4da3aacfd052ebec7 (diff)
downloadwilderness-war-86ab7f24be74b4c289924f5039a4fb5b46002c3f.tar.gz
Skip raiders go home if no survivors.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/rules.js b/rules.js
index 5f771aa..9b396fe 100644
--- a/rules.js
+++ b/rules.js
@@ -5679,14 +5679,19 @@ function can_follow_indians_home(from) {
}
function goto_raiders_go_home() {
- game.state = 'raiders_go_home';
- game.go_home = {
- reason: 'raid',
- who: 0,
- from: 0,
- to: 0,
- follow: {},
- };
+ // Surviving raiders must go home!
+ if (has_friendly_pieces(game.raid.where)) {
+ game.state = 'raiders_go_home';
+ game.go_home = {
+ reason: 'raid',
+ who: 0,
+ from: 0,
+ to: 0,
+ follow: {},
+ };
+ } else {
+ end_raiders_go_home();
+ }
}
function end_raiders_go_home() {