summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-12-09 20:49:49 +0100
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:12:55 +0100
commit1341c6003060c6e16d7bdd39b90360cac360c290 (patch)
tree7222a383a721193e74dca171a6c2aa2ff62bb7e2
parent1de4749b3c2fd2f51e78fcf674105df3ca431c46 (diff)
downloadrichard-iii-1341c6003060c6e16d7bdd39b90360cac360c290.tar.gz
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.
-rw-r--r--rules.js2
1 files changed, 1 insertions, 1 deletions
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;