summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/play.js b/play.js
index 7b72851..3e63b57 100644
--- a/play.js
+++ b/play.js
@@ -84,6 +84,15 @@ const piece_power = [
P_AUSTRIA, P_AUSTRIA
]
+const piece_rank = [
+ 1, 2, 3, 4, 5,
+ 1,
+ 1, 2, 3, 4,
+ 1,
+ 1, 2, 3,
+ 1, 2, 3, 4, 5, 6,
+]
+
const piece_abbr = [
"F1", "F2", "F3", "F4", "F5",
"B1",
@@ -688,7 +697,7 @@ function layout_general_offset(who, here) {
return 1
if ((view.supreme & (1 << other)) || view.selected === other)
return 0
- if (who < other)
+ if (piece_rank[who] < piece_rank[other])
return 1
return 0
}