default:
break;
case MT_CHECK:
- if(gameInfo.variant != VariantShogi)
+ if(!IS_SHOGI(gameInfo.variant))
strcat(parseList[moveNum - 1], "+");
break;
case MT_CHECKMATE:
default:
break;
case MT_CHECK:
- if(gameInfo.variant != VariantShogi)
+ if(!IS_SHOGI(gameInfo.variant))
strcat(parseList[boardIndex - 1], "+");
break;
case MT_CHECKMATE:
default:
break;
case MT_CHECK:
- if(gameInfo.variant != VariantShogi)
+ if(!IS_SHOGI(gameInfo.variant))
strcat(parseList[forwardMostMove - 1], "+");
break;
case MT_CHECKMATE:
king = flags & F_WHITE_ON_MOVE ? WhiteWazir : BlackWazir;
if(gameInfo.variant == VariantKnightmate)
king = flags & F_WHITE_ON_MOVE ? WhiteUnicorn : BlackUnicorn;
+ if(gameInfo.variant == VariantChu) { // strictly speaking this is not needed, as Chu officially has no check
+ int r, f, k = king, royals=0, prince = flags & F_WHITE_ON_MOVE ? WhiteMonarch : BlackMonarch;
+ for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++) {
+ if(board[r][f] == k || board[r][f] == prince) {
+ if(++royals > 1) return FALSE; // no check if we have two royals (ignores double captureby Lion!)
+ king = board[r][f]; // remember hich one we had
+ }
+ }
+ }
if (rt >= 0) {
if (enPassant) {
else if(gameInfo.variant == VariantGiveaway) return MT_STEALMATE; // no check exists, stalemated = win
return inCheck ? MT_CHECKMATE
- : (gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShatranj || gameInfo.variant == VariantShogi) ?
+ : (gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShatranj || IS_SHOGI(gameInfo.variant)) ?
MT_STAINMATE : MT_STALEMATE;
}
}