From 26a9295546ce08130f3688e5725b357c2a812a2d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 16 May 2021 12:46:41 +0200 Subject: hammer: Fix bug with border raid disbanding. Don't count blocks in the pool! --- rules.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 6ded111..21f6c57 100644 --- a/rules.js +++ b/rules.js @@ -1970,11 +1970,11 @@ states.regroup_to = { // BORDER RAIDS -function count_non_noble_english_blocks() { +function count_non_noble_english_blocks_on_map() { let count = 0; for (let b in BLOCKS) if (block_owner(b) == ENGLAND && block_type(b) != 'nobles') - if (game.location[b]) + if (is_on_map(b)) ++count; return count; } @@ -1983,7 +1983,7 @@ function goto_border_raids() { game.active = ENGLAND; if (is_enemy_area(ENGLAND)) { log("Scotland border raids."); - if (count_non_noble_english_blocks() > 0) { + if (count_non_noble_english_blocks_on_map() > 0) { game.state = 'border_raids'; } else { log("England has no non-noble blocks in play."); @@ -2000,7 +2000,7 @@ states.border_raids = { view.prompt = "Border Raids: Eliminate a non-Noble block."; for (let b in BLOCKS) if (block_owner(b) == ENGLAND && block_type(b) != 'nobles') - if (game.location[b]) + if (is_on_map(b)) gen_action(view, 'block', b); }, block: function (who) { -- cgit v1.2.3