Fix Euro-Shogi holdings size
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Apr 2018 21:03:37 +0000 (23:03 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Apr 2018 21:03:37 +0000 (23:03 +0200)
Euro-Shogi doesn't just have the Shogi Knight as dummy piece, but also
the Lance and Silver. (This to be able to use the piece definitions of
normal Shogi.) As it was the Euro-Knight would never be dropped.

dropper.c

index 6efba7b..efe22c1 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -361,7 +361,7 @@ waDirs[] = { 40, 69, 97, 67, 67, 74, 59, 59, 73, 87, 57, 96, 116, 121, 135, 99,
 char
 chessIDs[] = "PNBRQ",
 shogiIDs[] = "PLSGBRN",
-euroIDs[]  = "PLSGBR?N",
+euroIDs[]  = "P..GBR.N",
 toriIDs[]  = "SPLRCF",
 kyotoIDs[] = "PLSN............RTBG", // R, T, B, G are synonyms for +P, +L, +S and +N (written and recognized in drop moves)
 waIDs[]    = "POULCMGDVWHSRFXE",
@@ -540,7 +540,7 @@ GameInit (char *name)
     nrRanks = variants[v].ranks;
     zone    = variants[v].zone;
     pieces  = variants[v].pieces;
-    maxDrop = variants[v].hand - (pieces != euroIDs); // in Euro-Shogi the normal Shogi Knight is present as dummy (unused) piece
+    maxDrop = variants[v].hand;
     moves   = variants[v].dirs;
     startPos= variants[v].fen;
     codes   = variants[v].proms;
@@ -555,7 +555,7 @@ GameInit (char *name)
        printf("\n");
     }
 
-    maxDrop += (v==MINI_NR+1 || v==MINI_NR); // Judkins & mini-Shogi have dummy Lance
+    maxDrop += (v==MINI_NR+1 || v==MINI_NR) + 3*(pieces[1] == '.'); // Judkins & mini-Shogi have dummy Lance, Euro-Shogi dummy L, S and fN
 
     // board
     ClearBoard();