X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=a8e342d3920c42bdc049f8c1bfbf604d1109510e;hb=ebbd3101235b8a04c34b30eb9a037bb6bae71123;hp=561377380dbc54ba2a4d664ee0bf47a6537ff04f;hpb=77160c21009681c3a08fbef9e9025ab7212231b3;p=xboard.git diff --git a/backend.c b/backend.c index 5613773..a8e342d 100644 --- a/backend.c +++ b/backend.c @@ -152,7 +152,6 @@ void read_from_player P((InputSourceRef isr, VOIDSTAR closure, char *buf, int count, int error)); void read_from_ics P((InputSourceRef isr, VOIDSTAR closure, char *buf, int count, int error)); -void ics_printf P((char *format, ...)); void SendToICS P((char *s)); void SendToICSDelayed P((char *s, long msdelay)); void SendMoveToICS P((ChessMove moveType, int fromX, int fromY, int toX, int toY, char promoChar)); @@ -6563,10 +6562,9 @@ void UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) { ChessMove moveType; - ChessSquare pdown, pup; + ChessSquare pup; int ff=fromX, rf=fromY, ft=toX, rt=toY; - /* Check if the user is playing in turn. This is complicated because we let the user "pick up" a piece before it is his turn. So the piece he tried to pick up may have been captured by the time he puts it down! @@ -6702,7 +6700,6 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) } if(toX < 0 || toY < 0) return; - pdown = boards[currentMove][fromY][fromX]; pup = boards[currentMove][toY][toX]; /* [HGM] If move started in holdings, it means a drop. Convert to standard form */ @@ -7204,9 +7201,9 @@ LeftClick (ClickType clickType, int xPix, int yPix) if(!sweepSelecting) { toX = x; toY = y; - saveAnimate = appData.animate; } else sweepSelecting = 0; // this must be the up-click corresponding to the down-click that started the sweep + saveAnimate = appData.animate; if (clickType == Press) { if(gameMode == EditPosition && boards[currentMove][fromY][fromX] == EmptySquare) { // must be Edit Position mode with empty-square selected @@ -11563,7 +11560,7 @@ QuickCompare (Board board, int *minCounts, int *maxCounts) int QuickScan (Board board, Move *move) { // reconstruct game,and compare all positions in it - int cnt=0, stretch=0, total = MakePieceList(board, counts), delayedKing = -1; + int cnt=0, stretch=0, total = MakePieceList(board, counts); do { int piece = move->piece; int to = move->to, from = pieceList[piece]; @@ -11610,7 +11607,7 @@ QuickScan (Board board, Move *move) if(stretch++ == 0) for(i=0; i= appData.stretch)) return cnt + 1 - stretch; - move++; delayedKing = -1; + move++; } while(1); } @@ -12545,7 +12542,6 @@ int SaveGamePGN (FILE *f) { int i, offset, linelen, newblock; - time_t tm; // char *movetext; char numtext[32]; int movelen, numlen, blank; @@ -12553,8 +12549,6 @@ SaveGamePGN (FILE *f) offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - tm = time((time_t *) NULL); - PrintPGNTags(f, &gameInfo); if(appData.numberTag && matchMode) fprintf(f, "[Number \"%d\"]\n", nextGame+1); // [HGM] number tag @@ -13607,11 +13601,6 @@ TwoMachinesEvent P((void)) if (appData.noChessProgram) return; - if(second.protocolVersion >= 2 && !strstr(second.variants, VariantName(gameInfo.variant))) { - DisplayError("second engine does not play this", 0); - return; - } - switch (gameMode) { case TwoMachinesPlay: return; @@ -13650,6 +13639,12 @@ TwoMachinesEvent P((void)) ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); return; } + + if(second.protocolVersion >= 2 && !strstr(second.variants, VariantName(gameInfo.variant))) { + DisplayError("second engine does not play this", 0); + return; + } + if(!stalling) { InitChessProgram(&second, FALSE); // unbalances ping of second engine SendToProgram("force\n", &second);