X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=14cdf0cc50b72ae7b04b67adf98f1e61c0e3de39;hb=377bf9818b41e22a35bf96ede1252cd7088e8a66;hp=9c96909321d5745f6a19d621f367ededccdcc089;hpb=0341f6c4750c810e96124a7dc362003108a24e89;p=xboard.git diff --git a/backend.c b/backend.c index 9c96909..14cdf0c 100644 --- a/backend.c +++ b/backend.c @@ -834,6 +834,7 @@ InitEngine(ChessProgramState *cps, int n) } InitEngineUCI( installDir, cps ); // [HGM] moved here from winboard.c, to make available in xboard + ParseFeatures(appData.featureDefaults, cps); } ChessProgramState *savCps; @@ -3862,6 +3863,7 @@ read_from_ics(isr, closure, data, count, error) strncmp(why, "Continuing ", 11) == 0) { gs_gamenum = gamenum; safeStrCpy(gs_kind, strchr(why, ' ') + 1,sizeof(gs_kind)/sizeof(gs_kind[0])); + if(ics_gamenum == -1) // [HGM] only if we are not already involved in a game (because gin=1 sends us such messages) VariantSwitch(boards[currentMove], StringToVariant(gs_kind)); // [HGM] variantswitch: even before we get first board #if ZIPPY if (appData.zippyPlay) { @@ -4950,6 +4952,11 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar) char promoChar; { char user_move[MSG_SIZ]; + char suffix[4]; + + if(gameInfo.variant == VariantSChess && promoChar) + snprintf(suffix, 4, "=%c", toX == BOARD_WIDTH<<1 ? ToUpper(promoChar) : ToLower(promoChar)); + else suffix[0] = NULLCHAR; switch (moveType) { default: @@ -4965,7 +4972,7 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar) case WhiteHSideCastleFR: case BlackHSideCastleFR: /* POP Fabien */ - snprintf(user_move, MSG_SIZ, "o-o\n"); + snprintf(user_move, MSG_SIZ, "o-o%s\n", suffix); break; case WhiteQueenSideCastle: case BlackQueenSideCastle: @@ -4975,7 +4982,7 @@ SendMoveToICS(moveType, fromX, fromY, toX, toY, promoChar) case WhiteASideCastleFR: case BlackASideCastleFR: /* POP Fabien */ - snprintf(user_move, MSG_SIZ, "o-o-o\n"); + snprintf(user_move, MSG_SIZ, "o-o-o%s\n",suffix); break; case WhiteNonPromotion: case BlackNonPromotion: @@ -9539,6 +9546,7 @@ InitChessProgram(cps, setup) hintRequested = FALSE; bookRequested = FALSE; + ParseFeatures(appData.features[cps == &second], cps); // [HGM] allow user to overrule features /* [HGM] some new WB protocol commands to configure engine are sent now, if engine supports them */ /* moved to before sending initstring in 4.3.15, so Polyglot can delay UCI 'isready' to recepton of 'new' */ if(cps->memSize) { /* [HGM] memory */