summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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