From: H.G. Muller Date: Sun, 16 Jan 2011 20:37:16 +0000 (+0100) Subject: Fix type-in of drop moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ba08fd2edd5908cc6ef3330b1bb3b049b931b681;p=xboard.git Fix type-in of drop moves Drop moves entered through the move type-in already come in the (piece, DROP_RANK, x, y) format, rather than having a holdings from square. This caused UserMoveEvent to consider them illegal when testing if the piecewas of the side to move, and when this was fixed, to recognize Knight drops as coming from between board and holdings (and thus illegal). --- diff --git a/backend.c b/backend.c index 75fc9a1..26b7d80 100644 --- a/backend.c +++ b/backend.c @@ -5985,6 +5985,7 @@ UserMoveEvent(fromX, fromY, toX, toY, promoChar) case BeginningOfGame: case AnalyzeMode: case Training: + if(fromY == DROP_RANK) break; // [HGM] drop moves (entered through move type-in) are automatically assigned to side-to-move if ((int) boards[currentMove][fromY][fromX] >= (int) BlackPawn && (int) boards[currentMove][fromY][fromX] < (int) EmptySquare) { /* User is moving for Black */ @@ -6079,7 +6080,7 @@ UserMoveEvent(fromX, fromY, toX, toY, promoChar) pup = boards[currentMove][toY][toX]; /* [HGM] If move started in holdings, it means a drop. Convert to standard form */ - if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) { + if( (fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) && fromY != DROP_RANK ) { if( pup != EmptySquare ) return; moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; if(appData.debugMode) fprintf(debugFP, "Drop move %d, curr=%d, x=%d,y=%d, p=%d\n",