summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-25 19:08:28 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commitfd3f5c5ae56793b7a9ded795720864e2ecbbba9b (patch)
treec255649867dc4dc85b037e2119a550f9fe604c99
parent309621812e00007c49c9f5976b0e76457c266501 (diff)
downloadfriedrich-fd3f5c5ae56793b7a9ded795720864e2ecbbba9b.tar.gz
fix supply train breakage in previous commit
-rw-r--r--play.js2
-rw-r--r--rules.js13
2 files changed, 11 insertions, 4 deletions
diff --git a/play.js b/play.js
index f2dc0a2..51a2b73 100644
--- a/play.js
+++ b/play.js
@@ -3,6 +3,8 @@
// vim: set nowrap:
// TODO: sort selected generals above deselected generals when detaching?
+// TODO: show battle icon overlay (instead of roads)
+// TODO: remove roads and path highlighting code
const svgNS = "http://www.w3.org/2000/svg"
diff --git a/rules.js b/rules.js
index 701044e..f0b082d 100644
--- a/rules.js
+++ b/rules.js
@@ -1352,11 +1352,16 @@ states.movement = {
piece(p) {
push_undo()
- game.selected = []
let here = game.pos[p]
- for (let other of all_power_generals[game.power])
- if (other >= p && game.pos[other] === here && !set_has(game.moved, other))
- game.selected.push(other)
+
+ if (is_general(p)) {
+ game.selected = []
+ for (let other of all_power_generals[game.power])
+ if (other >= p && game.pos[other] === here && !set_has(game.moved, other))
+ game.selected.push(other)
+ } else {
+ game.selected = [ p ]
+ }
game.count = 0