Make mate test handle Shogi
[capablanca.git] / lasker-2.2.3 / src / movecheck.c
index 30ada65..468a8a3 100644 (file)
@@ -1767,10 +1767,8 @@ int has_legal_move(struct game_state_t * gs)
          if(game_globals.garray[gs->gameNum].link < 0) {
                // we have no partner, so we must have something to drop now
                for(i=QUEEN; i>=PAWN; i--)
-                       if(gs->holding[gs->onMove==WHITE ? 0 : 1][i-1]) break;
-               if(i > PAWN) return 1; // we have a non-Pawn to drop
-               // We have a Pawn, but check if it legal to drop it
-               if(i == PAWN && r != 0 && r != gs->ranks-1) return 1; // [HGM] todo: for Shogi there are extra conditions on Pawn drops!
+                       if (legal_andcheck_move(gs, ALG_DROP, i, f, r)) return 1;\r
+               return 0;
          }\r
          return 1;\r
        }\r