Datagen #46

Merged
rektdie merged 27 commits from datagen into main 2025-04-03 03:54:14 +02:00
Showing only changes of commit 44af851081 - Show all commits
+5 -1
View File
@@ -222,6 +222,7 @@ void Board::Promote(int square, int pieceType, int color, bool isCapture) {
} }
bool Board::MakeMove(Move move) { bool Board::MakeMove(Move move) {
Board save = *this;
// Null Move // Null Move
if (!move) { if (!move) {
int newEpTarget = noEPTarget; int newEpTarget = noEPTarget;
@@ -347,7 +348,10 @@ bool Board::MakeMove(Move move) {
MOVEGEN::GenThreatMaps(*this); MOVEGEN::GenThreatMaps(*this);
sideToMove = !sideToMove; sideToMove = !sideToMove;
if (InCheck()) return false; if (InCheck()) {
*this = save;
return false;
}
sideToMove = !sideToMove; sideToMove = !sideToMove;
if (attackerColor == Black) fullMoves++; if (attackerColor == Black) fullMoves++;