diff options
-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 |