ChessProgramState *engineOpponent = (gameMode == TwoMachinesPlay ? cps->other : (cps ? NULL : &first));
Boolean canAdjudicate = !appData.icsActive;
- // most tests only when we understand the game, i.e. legality-checking on, and (for the time being) no piece drops
- if(gameInfo.holdingsSize == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) {
+ // most tests only when we understand the game, i.e. legality-checking on
if( appData.testLegality )
{ /* [HGM] Some more adjudications for obstinate engines */
int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+1], i;
}
} else moveCount = 6;
}
- }
if (appData.debugMode) { int i;
fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n",
if (cl.count > 0) {
return inCheck ? MT_CHECK : MT_NONE;
} else {
+ if(gameInfo.holdingsWidth && gameInfo.variant != VariantSuper || gameInfo.variant != VariantGreat) { // drop game
+ int r, f, n, holdings = flags & F_WHITE_ON_MOVE ? BOARD_WIDTH-1 : 0;
+ for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++) if(board[r][f] == EmptySquare) // all empty squares
+ for(n=0; n<BOARD_HEIGHT; n++) // all pieces in hand
+ if(board[n][holdings] != EmptySquare) {
+ int moveType = LegalDrop(board, flags, board[n][holdings], r, f);
+ if(moveType == WhiteDrop || moveType == BlackDrop) return MT_CHECK; // we can resolve check by legal drop
+ }
+ }
if(gameInfo.variant == VariantSuicide) // [HGM] losers: always stalemate, since no check, but result varies
return myPieces == hisPieces ? MT_STALEMATE :
myPieces > hisPieces ? MT_STAINMATE : MT_STEALMATE;