Prevent empty squares on holdings rank in Edit Position
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 5 Apr 2020 21:01:25 +0000 (23:01 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 5 Apr 2020 21:01:25 +0000 (23:01 +0200)
When a piece is moved away from the gating rank in holdingless Seirawan,
the evacuated square is now automatically blacked out.

backend.c

index f49b273..aff8ada 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -7222,6 +7222,8 @@ UserMoveEvent (int fromX, int fromY, int toX, int toY, int promoChar)
                    if(boards[0][fromY][BOARD_WIDTH-2]) boards[0][fromY][BOARD_WIDTH-2]--;
                    if(boards[0][fromY][BOARD_WIDTH-2] == 0)  boards[0][fromY][BOARD_WIDTH-1] = EmptySquare;
                }
+           } else if(gameInfo.variant == VariantSChess && !gameInfo.holdingsSize && gatingPiece == EmptySquare && (fromY == 0 || fromY == BOARD_HEIGHT-1)) {
+               boards[0][fromY][fromX] = DarkSquare; // empty on gating rank -> dark
            } else
            boards[0][fromY][fromX] = gatingPiece;
            ClearHighlights();