bugfix: attackMaps wasn't updating
This commit is contained in:
1 parent
d6574824fd
commit
72b327c3ff
3 files changed
+5
-4
No files matched your search
@@ -396,4 +396,6 @@ void Board::MakeMove(Move move) {
|
|||||||
halfMoves++;
|
halfMoves++;
|
||||||
if (halfMoves & 2 == 0) fullMoves++;
|
if (halfMoves & 2 == 0) fullMoves++;
|
||||||
sideToMove = !attackerColor;
|
sideToMove = !attackerColor;
|
||||||
|
|
||||||
|
GenAttackMaps(*this);
|
||||||
}
|
}
|
||||||
+2
-3
@@ -9,9 +9,8 @@ int main() {
|
|||||||
initSliderAttacks();
|
initSliderAttacks();
|
||||||
|
|
||||||
Board board;
|
Board board;
|
||||||
board.SetByFen("r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1R1K b kq - 1 1");
|
board.SetByFen("r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1");
|
||||||
board.PrintBoard();
|
Perft(board, 1);
|
||||||
Perft(board, 2);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -825,6 +825,7 @@ static void GenCheckEvasions(Board &board, bool color) {
|
|||||||
if (checkerType == Rook || checkerType == Bishop || checkerType == Queen) {
|
if (checkerType == Rook || checkerType == Bishop || checkerType == Queen) {
|
||||||
pushMask = SliderRayToSquare(checkerSquare, kingSquare);
|
pushMask = SliderRayToSquare(checkerSquare, kingSquare);
|
||||||
pushMask.PopBit(kingSquare);
|
pushMask.PopBit(kingSquare);
|
||||||
|
pushMask.PopBit(checkerSquare);
|
||||||
}
|
}
|
||||||
|
|
||||||
// looping through own pieces to add captures and blocks
|
// looping through own pieces to add captures and blocks
|
||||||
@@ -854,7 +855,6 @@ static void GenCheckEvasions(Board &board, bool color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
captures |= getPieceAttacks(square, type, color, board.occupied.GetBoard()) & captureMask;
|
captures |= getPieceAttacks(square, type, color, board.occupied.GetBoard()) & captureMask;
|
||||||
|
|
||||||
while (captures.GetBoard()) {
|
while (captures.GetBoard()) {
|
||||||
int captureSquare = captures.getLS1BIndex();
|
int captureSquare = captures.getLS1BIndex();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user