Fix bug NonPromotionPossible for mini-Shogi
[gnushogi.git] / gnushogi / genmove.c
index d42c1d6..f6a0ac3 100644 (file)
@@ -4,6 +4,7 @@
  * ----------------------------------------------------------------------
  * Copyright (c) 1993, 1994, 1995 Matthias Mutz
  * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
+ * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
  *
  * GNU SHOGI is based on GNU CHESS
  *
@@ -349,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));
         }