X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=4c9968f2b45161abf74ff60b5ffc614699e235a6;hb=bd85ed7a2aac57e6afa8fdab7f3a13ce22910b18;hp=bb79d8d507766720925c2acb20b8b6d8f4577d26;hpb=705fc964773ab699d4142c237f4b6d0bd9b2f5ae;p=xboard.git diff --git a/backend.c b/backend.c index bb79d8d..4c9968f 100644 --- a/backend.c +++ b/backend.c @@ -5016,6 +5016,11 @@ SendMoveToProgram (int moveNum, ChessProgramState *cps) char buf[MSG_SIZ]; if(moveList[moveNum][1] == '@' && moveList[moveNum][0] == '@') { + if(gameInfo.variant == VariantLion || gameInfo.variant == VariantChu) { + sprintf(buf, "%s@@@@\n", cps->useUsermove ? "usermove " : ""); + SendToProgram(buf, cps); + return; + } // null move in variant where engine does not understand it (for analysis purposes) SendBoard(cps, moveNum + 1); // send position after move in stead. return; @@ -5279,7 +5284,8 @@ ProcessICSInitScript (FILE *f) } -static int lastX, lastY, lastLeftX, lastLeftY, selectFlag, dragging; +static int lastX, lastY, lastLeftX, lastLeftY, selectFlag; +int dragging; static ClickType lastClickType; void @@ -5438,8 +5444,8 @@ ParseOneMove (char *move, int moveNum, ChessMove *moveType, int *fromX, int *fro if (appData.testLegality) { return (*moveType != IllegalMove); } else { - return !(*fromX == *toX && *fromY == *toY) && boards[moveNum][*fromY][*fromX] != EmptySquare && - killX < 0 && // [HGM] lion: if this is a double move we are less critical + return !(*fromX == *toX && *fromY == *toY && killX < 0) && boards[moveNum][*fromY][*fromX] != EmptySquare && + // [HGM] lion: if this is a double move we are less critical WhiteOnMove(moveNum) == (boards[moveNum][*fromY][*fromX] < BlackPawn); } @@ -7188,7 +7194,6 @@ HoverEvent (int xPix, int yPix, int x, int y) { static int oldX = -1, oldY = -1, oldFromX = -1, oldFromY = -1; int r, f; - if(dragging == 2) DragPieceMove(xPix, yPix); // [HGM] lion: drag without button for second leg if(!first.highlight) return; if(fromX != oldFromX || fromY != oldFromY) oldX = oldY = -1; // kludge to fake entry on from-click if(x == oldX && y == oldY) return; // only do something if we enter new square @@ -7459,7 +7464,6 @@ LeftClick (ClickType clickType, int xPix, int yPix) return; } if(dragging == 2) { // [HGM] lion: just turn buttonless drag into normal drag, and let release to the job - dragging = 1; return; } if(x == killX && y == killY) { // second click on this square, which was selected as first-leg target @@ -7507,9 +7511,9 @@ LeftClick (ClickType clickType, int xPix, int yPix) MarkTargetSquares(1); if(x == killX && y == killY) killX = killY = -1; else { killX = x; killY = y; //remeber this square as intermediate - MarkTargetSquares(0); ReportClick("put", x, y); // and inform engine ReportClick("lift", x, y); + MarkTargetSquares(0); return; } } @@ -8454,8 +8458,8 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h snprintf(buf1, MSG_SIZ*10, _("Illegal move \"%s\" from %s machine"), machineMove, _(cps->which)); DisplayMoveError(buf1); - snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to invalid move: %s (%c%c%c%c) res=%d", - machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, moveType); + snprintf(buf1, MSG_SIZ*10, "Xboard: Forfeit due to invalid move: %s (%c%c%c%c via %c%c) res=%d", + machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, killX+AAA, killY+ONE, moveType); if (gameMode == TwoMachinesPlay) { GameEnds(machineWhite ? BlackWins : WhiteWins, buf1, GE_XBOARD);