From dbdb79bfd888cc414c53f2f0640a4712dbb3da60 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Jul 2023 17:37:51 +0200 Subject: Fix Palmyra Allies bug. --- rules.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rules.js b/rules.js index 77eebd4..0de30e6 100644 --- a/rules.js +++ b/rules.js @@ -1629,9 +1629,11 @@ function goto_palmyra_allies() { function resume_palmyra_allies() { if ( - (find_active_barbarian_of_tribe(SASSANIDS, GALATIA) >= 0) || - (find_active_barbarian_of_tribe(SASSANIDS, SYRIA) >= 0) || - (find_active_barbarian_of_tribe(SASSANIDS, SASSANIDS_HOMELAND) >= 0) + game.count > 0 && ( + find_active_barbarian_of_tribe(GALATIA, SASSANIDS) >= 0 || + find_active_barbarian_of_tribe(SYRIA, SASSANIDS) >= 0 || + find_active_barbarian_of_tribe(SASSANIDS_HOMELAND, SASSANIDS) >= 0 + ) ) game.state = "palmyra_allies" else @@ -1653,23 +1655,21 @@ states.palmyra_allies = { if (where === GALATIA || where === SYRIA || where === SASSANIDS_HOMELAND) gen_action_barbarian(ARDASHIR) - id = find_active_non_leader_barbarian_of_tribe(SASSANIDS, GALATIA) + id = find_active_non_leader_barbarian_of_tribe(GALATIA, SASSANIDS) if (id >= 0) gen_action_barbarian(id) - id = find_active_non_leader_barbarian_of_tribe(SASSANIDS, SYRIA) + id = find_active_non_leader_barbarian_of_tribe(SYRIA, SASSANIDS) if (id >= 0) gen_action_barbarian(id) - id = find_active_non_leader_barbarian_of_tribe(SASSANIDS, SASSANIDS_HOMELAND) + id = find_active_non_leader_barbarian_of_tribe(SASSANIDS_HOMELAND, SASSANIDS) if (id >= 0) gen_action_barbarian(id) }, barbarian(id) { push_undo() eliminate_barbarian(id) - if (--game.count === 0) - goto_take_actions() - else - resume_palmyra_allies() + game.count -- + resume_palmyra_allies() }, } @@ -4817,7 +4817,7 @@ states.support_check_mobs = { }, region(where) { push_undo() - log("More mobs than support in %" + where + ".") + log("Too many mobs in %" + where + ".") remove_governor(where, true) goto_support_check_mobs() }, -- cgit v1.2.3