X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=55866495eecda262707a77171410bd26fc4cc7b1;hb=739a44fd95050c7986678c41f655bc89cfce7f0d;hp=6810648edeb4e508dd7eb0059058b70ccd73e379;hpb=dcc35623d911ee504e573f9c5d2148d102059312;p=xboard.git diff --git a/backend.c b/backend.c index 6810648..5586649 100644 --- a/backend.c +++ b/backend.c @@ -2953,22 +2953,23 @@ read_from_ics(isr, closure, data, count, error) } /* Error messages */ - if (ics_user_moved) { +// if (ics_user_moved) { + if (1) { // [HGM] old way ignored error after move type in; ics_user_moved is not set then! if (looking_at(buf, &i, "Illegal move") || looking_at(buf, &i, "Not a legal move") || looking_at(buf, &i, "Your king is in check") || looking_at(buf, &i, "It isn't your turn") || looking_at(buf, &i, "It is not your move")) { /* Illegal move */ - ics_user_moved = 0; - if (forwardMostMove > backwardMostMove) { + if (ics_user_moved && forwardMostMove > backwardMostMove) { // only backup if we already moved currentMove = --forwardMostMove; DisplayMove(currentMove - 1); /* before DMError */ - DisplayMoveError(_("Illegal move (rejected by ICS)")); DrawPosition(FALSE, boards[currentMove]); SwitchClocks(); DisplayBothClocks(); } + DisplayMoveError(_("Illegal move (rejected by ICS)")); // [HGM] but always relay error msg + ics_user_moved = 0; continue; } } @@ -3892,8 +3893,11 @@ ParseBoard12(string) DrawPosition(FALSE, boards[currentMove]); DisplayMove(moveNum - 1); - if (appData.ringBellAfterMoves && !ics_user_moved) - RingBell(); + if (appData.ringBellAfterMoves && /*!ics_user_moved*/ // [HGM] use absolute method to recognize own move + !((gameMode == IcsPlayingWhite) && (!WhiteOnMove(moveNum)) || + (gameMode == IcsPlayingBlack) && (WhiteOnMove(moveNum)) ) ) { + if(newMove) RingBell(); else PlayIcsUnfinishedSound(); + } } HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1);