From 86ab7f24be74b4c289924f5039a4fb5b46002c3f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 21 Mar 2022 02:06:04 +0100 Subject: Skip raiders go home if no survivors. --- rules.js | 21 +++++++++++++-------- 1 file 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() { -- cgit v1.2.3