X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=face7f14afb24bfb16843b8322025b64785a4bc5;hb=d397edb934a78bb4d0ceec02cd3768cc7244be99;hp=910d1d800efafc816cefa79fa470760258cb8011;hpb=570f0d333ffba03730d5bc5a69ef5a509247104f;p=xboard.git diff --git a/backend.c b/backend.c index 910d1d8..face7f1 100644 --- a/backend.c +++ b/backend.c @@ -4627,11 +4627,6 @@ InitPosition(redraw) break; case VariantTwoKings: pieces = twoKingsArray; - nrCastlingRights = 8; /* add rights for second King */ - castlingRights[0][6] = initialRights[2] = 5; - castlingRights[0][7] = initialRights[5] = 5; - castlingRank[6] = 0; - castlingRank[7] = BOARD_HEIGHT-1; break; case VariantCapaRandom: shuffleOpenings = TRUE; @@ -5881,7 +5876,8 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h } } - if( NrPieces == 2 || gameInfo.variant != VariantXiangqi && + if( NrPieces == 2 || gameInfo.variant != VariantXiangqi && + gameInfo.variant != VariantShatranj && // [HGM] baring will remain possible (NrPieces == 3 && NrWN+NrBN+NrWB+NrBB == 1 || NrPieces == NrBB+NrWB+2 && bishopsColor != 3)) // [HGM] all Bishops (Ferz!) same color { /* KBK, KNK, KK of KBKB with like Bishops */ @@ -7831,7 +7827,9 @@ GameEnds(result, resultDetails, whosays) } /* [HGM] bare: don't allow bare King to win */ if((gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) - && result != GameIsDrawn) + && gameInfo.variant != VariantLosers && gameInfo.variant != VariantGiveaway + && gameInfo.variant != VariantSuicide // [HGM] losers: except in losers, of course... + && result != GameIsDrawn) { int i, j, k=0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn); for(j=BOARD_LEFT; joptionSettings, opt->name); - if(p == cps->optionSettings || p[-1] == ',') { + if(cps->optionSettings && cps->optionSettings[0]) + p = strstr(cps->optionSettings, opt->name); else p = NULL; + if(p && (p == cps->optionSettings || p[-1] == ',')) { sprintf(buf, "option %s", p); if(p = strstr(buf, ",")) *p = 0; strcat(buf, "\n");