void
EditPositionDone()
{
+ int king = gameInfo.variant == VariantKnightmate ? WhiteUnicorn : WhiteKing;
+
startedFromSetupPosition = TRUE;
InitChessProgram(&first, FALSE);
+ castlingRights[0][2] = castlingRights[0][5] = BOARD_WIDTH>>1;
+ if(boards[0][0][BOARD_WIDTH>>1] == king) {
+ castlingRights[0][1] = boards[0][0][BOARD_LEFT] == WhiteRook ? 0 : -1;
+ castlingRights[0][0] = boards[0][0][BOARD_RGHT-1] == WhiteRook ? BOARD_RGHT-1 : -1;
+ } else castlingRights[0][2] = -1;
+ if(boards[0][BOARD_HEIGHT-1][BOARD_WIDTH>>1] == WHITE_TO_BLACK king) {
+ castlingRights[0][4] = boards[0][BOARD_HEIGHT-1][BOARD_LEFT] == BlackRook ? 0 : -1;
+ castlingRights[0][3] = boards[0][BOARD_HEIGHT-1][BOARD_RGHT-1] == BlackRook ? BOARD_RGHT-1 : -1;
+ } else castlingRights[0][5] = -1;
SendToProgram("force\n", &first);
if (blackPlaysFirst) {
strcpy(moveList[0], "");
if (BoolFeature(&p, "smp", &cps->maxCores, cps)) continue;
if (StringFeature(&p, "egt", &cps->egtFormats, cps)) continue;
if (StringFeature(&p, "option", &(cps->option[cps->nrOptions].name), cps)) {
- ParseOption(&(cps->option[cps->nrOptions++]), cps); // [HGM] options: add option feature
+ if(!ParseOption(&(cps->option[cps->nrOptions++]), cps)) { // [HGM] options: add option feature
+ sprintf(buf, "rejected option %s\n", cps->option[--cps->nrOptions].name);
+ SendToProgram(buf, cps);
+ continue;
+ }
if(cps->nrOptions >= MAX_OPTIONS) {
cps->nrOptions--;
sprintf(buf, "%s engine has too many options\n", cps->which);
DrawPosition(FALSE, boards[currentMove]);
}
}
-}
\ No newline at end of file
+}