Open osvitashev opened 3 years ago
For anyone wondering, the solution is to create a new board and copy over the position.
Position newBoard;
Position::set(brokenBoard.fen(), newBoard);
// Use newBoard from here
@Dark42ed nice temporary fix, but I'll be reworking Position::set soon, it's the most poorly implemented function in the whole library. The idea of having this function was originally pinched from Stockfish, but I think it would probably go better in the default/copy constructors.
As far as i can say Position::set assumes the object is blank and does not clear the existing values in it, which leads to wrong move generation if the object is reused: