From c5bd03c1c31830e027ff75134ad80f5e2a8caf84 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 22 Jul 2021 11:34:27 +0200 Subject: crusader: Fix bug in Jihad selection and display. Enemy of null is null! --- rules.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 250b6c6..58c0028 100644 --- a/rules.js +++ b/rules.js @@ -136,7 +136,9 @@ function print_summary(text, skip_if_empty = false) { } function enemy(p) { - return (p === FRANKS) ? SARACENS : FRANKS; + if (p === FRANKS) return SARACENS; + if (p === SARACENS) return FRANKS; + return null; } function is_inactive_player(current) { @@ -3644,6 +3646,7 @@ function make_battle_view() { round: game.combat_round, show_castle: game.show_castle, show_field: game.show_field, + town: game.where, }; if (is_under_siege(game.where) && !is_contested_battle_field(game.where)) @@ -3654,10 +3657,8 @@ function make_battle_view() { battle.title += " \u2014 Combat Deployment"; else battle.title += " \u2014 Round " + game.combat_round + " of 3"; - if (game.where === game.jihad) { - battle.jihad = game.attacker[game.where]; + if (game.where === game.jihad) battle.title += " \u2014 Jihad!"; - } function fill_cell(cell, owner, fn) { for (let b in BLOCKS) -- cgit v1.2.3