Closed ajax333221 closed 3 years ago
Messing with the board information will obviously cause unexpected results.
If someone must do some changes then he should consider rebuilding the fen with board.updateFenAndMisc()
and then validating the new board.fen
.
Example 1: If you load
"rnbqkbnr/1pp1ppp1/p6p/8/8/1PNpP2P/PBPPQPP1/R3KBNR w KQkq - 0 7"
then remove the a1 Rook (without modifying the castle rights), you will still be able to castle and a Rook will appear after castling.Example 2: If you load
"rnbqkbnr/ppp2ppp/3p4/2Pp4/8/8/PP2PPPP/RNBQKBNR w KQkq - 5 7"
then add an en passant in d6board.enPassantBos = "d6"
, playing the move"c5-d6"
will cause the d5 Pawn to disappear.Example 3: In the default position, if you change the half move clock
board.halfMove = 99
then move a Knight, the "Is fifty-move rule?" will be true.Etc.