summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-04-02 17:24:42 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commite56350909b0831d606f5f6de54088f943fda6c70 (patch)
tree515b614c4d46145b880b624980634bee292f0fc1
parentabf4f42a1fb32c6b31a1268e14e3a3925c79b13e (diff)
downloadwilderness-war-e56350909b0831d606f5f6de54088f943fda6c70.tar.gz
Fix bug with siege without commanding officer.
-rw-r--r--play.css4
-rw-r--r--rules.js10
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;