From: H.G. Muller Date: Mon, 11 Oct 2010 19:52:10 +0000 (+0200) Subject: Make mate test handle Shogi X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=aabaa926fde2f7cd599776bd6ae0f6868eb892da;p=capablanca.git Make mate test handle Shogi If we must rely on interposing drop for resolving the check, now use legal_andcheck_move() to test if the drop is legal. --- diff --git a/lasker-2.2.3/src/movecheck.c b/lasker-2.2.3/src/movecheck.c index 30ada65..468a8a3 100644 --- a/lasker-2.2.3/src/movecheck.c +++ b/lasker-2.2.3/src/movecheck.c @@ -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; + return 0; } return 1; }