summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-21 11:45:33 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-21 11:51:54 +0200
commitd47d48c2d24f65ee8c753f175dcbb3e0b4ed18ec (patch)
tree1731d9496ef2bf20deb4cd43480f22551004df30 /play.js
parent5b20a8ae9194fe76c6b589005687a6e33682e1ef (diff)
downloadmaria-d47d48c2d24f65ee8c753f175dcbb3e0b4ed18ec.tar.gz
winter recruitment
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
}