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 09:49:01 +0000 (10:49 +0100)
For Pawns the check for last-rank was not adapted to 5x5 board.

gnushogi/genmove.c

index a2c1c09..2f4db1b 100644 (file)
@@ -336,13 +336,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));
         }