From a2875470324f942b5a8f696a5f30f1e26e793252 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 9 Feb 2015 10:09:55 +0100 Subject: [PATCH 1/1] 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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) && -- 1.7.0.4