From b6af8b17db4cf325069fd22bb3dbdd607e3754b8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 6 May 2021 18:51:30 +0200 Subject: richard: Fix can_attempt_treason_event. Check the right blocks! --- rules.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 7ae65d1..f4340ea 100644 --- a/rules.js +++ b/rules.js @@ -481,14 +481,14 @@ function can_defect(source, target) { } function can_attempt_treason_event() { - for (let b in BLOCKS) { - if (game.active == game.attacker[game.where]) { + if (game.treason == game.attacker[game.where]) { + for (let b in BLOCKS) if (is_defender(b) && can_defect(null, b)) return true; - } else { + } else { + for (let b in BLOCKS) if (is_attacker(b) && can_defect(null, b)) return true; - } } return false; } -- cgit v1.2.3