Fix bug NonPromotionPossible for mini-Shogi
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 5 Mar 2014 09:49:01 +0000 (10:49 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 5 Mar 2014 10:24:42 +0000 (11:24 +0100)
For Pawns the check for last-rank was not adapted to 5x5 board.

gnushogi/genmove.c

index 208966d..f6a0ac3 100644 (file)
@@ -350,13 +350,21 @@ NonPromotionPossible(short color,
     case pawn :
         if (color == black)
         {
+#ifdef MINISHOGI
+            return ((t < 20)
+#else
             return ((t < 72)
+#endif
                     ? true
                     : (generate_move_flags ? ILLEGAL_TRAPPED : false));
         }
         else
         {
+#ifdef MINISHOGI
+            return ((t > 4)
+#else
             return ((t > 8)
+#endif
                     ? true
                     : (generate_move_flags ? ILLEGAL_TRAPPED : false));
         }