diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-25 19:08:28 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | fd3f5c5ae56793b7a9ded795720864e2ecbbba9b (patch) | |
tree | c255649867dc4dc85b037e2119a550f9fe604c99 | |
parent | 309621812e00007c49c9f5976b0e76457c266501 (diff) | |
download | friedrich-fd3f5c5ae56793b7a9ded795720864e2ecbbba9b.tar.gz |
fix supply train breakage in previous commit
-rw-r--r-- | play.js | 2 | ||||
-rw-r--r-- | rules.js | 13 |
2 files changed, 11 insertions, 4 deletions
@@ -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" @@ -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 |