From 5f5ea25ea2421cdf6d620d05548c2efa3d81783f Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 9 Apr 2014 09:19:43 +0200 Subject: [PATCH] Make EditPosition pallette work in Asian variants Construction of the pallette position was not working in variants that did not have Pawns start on 2nd rank, or that had multiple ranks of pieces. Now the algorithm is applied to all ranks. --- backend.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend.c b/backend.c index 88fed00..b05e795 100644 --- a/backend.c +++ b/backend.c @@ -15013,14 +15013,14 @@ EditPositionMenuEvent (ChessSquare selection, int x, int y) boards[0][y][x] = p; } } - menuBoard[1][x] = menuBoard[BOARD_HEIGHT-2][x] = p; } if(gameMode != IcsExamining) { // [HGM] editpos: cycle trough boards - for(x = BOARD_LEFT; x < BOARD_RGHT; x++) { // create 'menu board' by removing duplicates - ChessSquare p = menuBoard[0][x]; - for(y = x + 1; y < BOARD_RGHT; y++) if(menuBoard[0][y] == p) menuBoard[0][y] = EmptySquare; - p = menuBoard[BOARD_HEIGHT-1][x]; - for(y = x + 1; y < BOARD_RGHT; y++) if(menuBoard[BOARD_HEIGHT-1][y] == p) menuBoard[BOARD_HEIGHT-1][y] = EmptySquare; + int r; + for(r = 0; r < BOARD_HEIGHT; r++) { + for(x = BOARD_LEFT; x < BOARD_RGHT; x++) { // create 'menu board' by removing duplicates + ChessSquare p = menuBoard[r][x]; + for(y = x + 1; y < BOARD_RGHT; y++) if(menuBoard[r][y] == p) menuBoard[r][y] = EmptySquare; + } } DisplayMessage("Clicking clock again restores position", ""); if(gameInfo.variant != lastVariant) lastVariant = gameInfo.variant, CopyBoard(erasedBoard, boards[0]); -- 1.7.0.4