From 1341c6003060c6e16d7bdd39b90360cac360c290 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 9 Dec 2021 20:49:49 +0100 Subject: Fix bug with finding a senior heir when all the non-minor heirs are dead. Allow a minor heir to be the pretender before he has entered the map. --- rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 159d8d3..054d134 100644 --- a/rules.js +++ b/rules.js @@ -2269,7 +2269,7 @@ function find_minor_heir(owner) { function find_senior_heir(owner) { let candidate = null; for (let b in BLOCKS) - if (block_owner(b) === owner && block_type(b) === 'heir' && is_block_on_map(b)) + if (block_owner(b) === owner && block_type(b) === 'heir' && !is_dead(b)) if (!candidate || BLOCKS[b].heir < BLOCKS[candidate].heir) candidate = b; return candidate; -- cgit v1.2.3