Prevent spoiling of castling rights on setup
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 15 May 2017 12:16:56 +0000 (14:16 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 15 May 2017 12:16:56 +0000 (14:16 +0200)
The undo info is now initialized to a dummy move on a3 rather than a1,
so that the white Q-side castling rules are not immediately spoiled
through suspecting a Rook move.

dropper.c

index f3f4ee1..aa314a3 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1528,7 +1528,7 @@ Setup (char *fen)
     fen++;
   }
 
-  undoInfo.rights = rights;
+  undoInfo.rights = rights; undoInfo.fromSqr = undoInfo.toSqr = undoInfo.captSqr = 44; undoInfo.toPiece = board[44]; // kludge to prevent spoiling of rights
   undoInfo.newEval = (stm == WHITE ? pstEval : -pstEval);
   undoInfo.newKey = hashKey;