From: H.G.Muller Date: Mon, 9 Feb 2015 09:09:55 +0000 (+0100) Subject: Fix deselection of piece X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=a2875470324f942b5a8f696a5f30f1e26e793252 Fix deselection of piece The patch to allow entering of friendly capture (intended as a kludge for entering non-standard castling) had broken the ability to change the selected piece by clicking another piece, as this was now always interpreted as a friendly capture (which was then rejected as illegal). By testing marker[][] in stead of legal[][] this can be avoided; legal[][] was not a good measure, because in absence of a highlight command it is completely filled with 1, to make everything legal. No friendly squares will ever get marked unless a highlight command does it, though. --- diff --git a/backend.c b/backend.c index 7747844..5b66016 100644 --- a/backend.c +++ b/backend.c @@ -7519,7 +7519,7 @@ printf("to click %d,%d\n",x,y); toP = boards[currentMove][y][x]; frc = appData.fischerCastling || gameInfo.variant == VariantSChess; if( (killX < 0 || x != fromX || y != fromY) && // [HGM] lion: do not interpret igui as deselect! - legal[y][x] == 0 && // if engine told we can move to here, do it even if own piece + marker[y][x] == 0 && // if engine told we can move to here, do it even if own piece ((WhitePawn <= fromP && fromP <= WhiteKing && WhitePawn <= toP && toP <= WhiteKing && !(fromP == WhiteKing && toP == WhiteRook && frc) &&