diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-03-21 02:06:04 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 11:54:52 +0100 |
commit | 86ab7f24be74b4c289924f5039a4fb5b46002c3f (patch) | |
tree | 1374c636d7fc3aed236cc7ad0ccb9b4872821105 | |
parent | 9c68a47171603a584b2ed2a4da3aacfd052ebec7 (diff) | |
download | wilderness-war-86ab7f24be74b4c289924f5039a4fb5b46002c3f.tar.gz |
Skip raiders go home if no survivors.
-rw-r--r-- | rules.js | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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() { |