From e56350909b0831d606f5f6de54088f943fda6c70 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Apr 2022 17:24:42 +0200 Subject: Fix bug with siege without commanding officer. --- play.css | 4 ---- rules.js | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/play.css b/play.css index fb7317c..732f198 100644 --- a/play.css +++ b/play.css @@ -134,10 +134,6 @@ aside { width: 220px; } #popup div.enabled:hover { background-color: black; color: white; } #popup div.always { display: block; } -.card.highlight { - outline: 2px solid yellow; -} - /* MAP */ #mapwrap { diff --git a/rules.js b/rules.js index 43a689c..b10868b 100644 --- a/rules.js +++ b/rules.js @@ -5599,10 +5599,12 @@ function can_moving_force_siege_or_assault() { let where = moving_piece_space(); if (has_besieged_enemy_fortifications(where)) { let commanding = find_friendly_commanding_leader_in_space(where); - let cmd_rank = leader_command(commanding); - let ldr_rank = leader_command(leader); - if (ldr_rank === cmd_rank && force_has_supplied_drilled_troops(leader)) { - return true; + if (commanding > 0) { + let cmd_rank = leader_command(commanding); + let ldr_rank = leader_command(leader); + if (ldr_rank === cmd_rank && force_has_supplied_drilled_troops(leader)) { + return true; + } } } return false; -- cgit v1.2.3