From d47d48c2d24f65ee8c753f175dcbb3e0b4ed18ec Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 21 Oct 2024 11:45:33 +0200 Subject: winter recruitment --- play.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'play.js') 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 } -- cgit v1.2.3