X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=125fd3de4590026beac1ae7e719841903414a149;hb=e921ccb3b79c9cfc5657e715eb50b5d9ed298db8;hp=f74b597b94a0ebc97557310d6619435033951f31;hpb=c02489ef9e5b337bff38fd5a8594b8117f991c45;p=xboard.git diff --git a/backend.c b/backend.c index f74b597..125fd3d 100644 --- a/backend.c +++ b/backend.c @@ -7056,6 +7056,7 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) if(addToBookFlag) { // adding moves to book char buf[MSG_SIZ], move[MSG_SIZ]; CoordsToAlgebraic(boards[currentMove], PosFlags(currentMove), fromY, fromX, toY, toX, promoChar, move); + if(killX >= 0) snprintf(move, MSG_SIZ, "%c%dx%c%d-%c%d", fromX + AAA, fromY + ONE - '0', killX + AAA, killY + ONE - '0', toX + AAA, toY + ONE - '0'); snprintf(buf, MSG_SIZ, " 0.0%% 1 %s\n", move); AddBookMove(buf); addToBookFlag = FALSE; @@ -8695,7 +8696,12 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(machineMove[strlen(machineMove)-1] == ',') { // move ends in coma: non-final leg of composite move safeStrCpy(firstLeg, machineMove, 20); // just remember it for processing when second leg arrives return; - } else if(firstLeg[0]) { // there was a previous leg; + } + if(p = strchr(machineMove, ',')) { // we got both legs in one (happens on book move) + safeStrCpy(firstLeg, machineMove, 20); // kludge: fake we received the first leg earlier, and clip it off + safeStrCpy(machineMove, firstLeg + (p - machineMove) + 1, 20); + } + if(firstLeg[0]) { // there was a previous leg; // only support case where same piece makes two step char buf[20], *p = machineMove+1, *q = buf+1, f; safeStrCpy(buf, machineMove, 20);