From aabaa926fde2f7cd599776bd6ae0f6868eb892da Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 11 Oct 2010 21:52:10 +0200 Subject: [PATCH] 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. --- lasker-2.2.3/src/movecheck.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) 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; } -- 1.7.0.4