fixed a bug in previous commit + doublePawnPushes were not working
This commit is contained in:
1 parent
e4ca91d565
commit
c97c3acb27
3 files changed
+27
-10
No files matched your search
+10
-2
@@ -538,7 +538,11 @@ static void GenPawnMoves(Board &board, bool color) {
|
||||
board.AddMove(Move(square, pushSquare, rookPromotion));
|
||||
board.AddMove(Move(square, pushSquare, queenPromotion));
|
||||
} else {
|
||||
board.AddMove(Move(square, pushSquare, quiet));
|
||||
if (abs(pushSquare - square) == 16) {
|
||||
board.AddMove(Move(square, pushSquare, doublePawnPush));
|
||||
} else {
|
||||
board.AddMove(Move(square, pushSquare, quiet));
|
||||
}
|
||||
}
|
||||
|
||||
pushes.PopBit(pushSquare);
|
||||
@@ -884,7 +888,11 @@ static void GenCheckEvasions(Board &board, bool color) {
|
||||
while (pushes.GetBoard()) {
|
||||
int pushSquare = pushes.getLS1BIndex();
|
||||
|
||||
board.AddMove(Move(square, pushSquare, quiet));
|
||||
if (type == Pawn && abs(pushSquare - square) == 16) {
|
||||
board.AddMove(Move(square, pushSquare, doublePawnPush));
|
||||
} else {
|
||||
board.AddMove(Move(square, pushSquare, quiet));
|
||||
}
|
||||
|
||||
pushes.PopBit(pushSquare);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user