diff --git a/src/search/move_list.h b/src/search/move_list.h index 0b39d61..f31d0b0 100644 --- a/src/search/move_list.h +++ b/src/search/move_list.h @@ -19,6 +19,7 @@ #include "../core/movegen.h" #include "history.h" +#include "see.h" namespace search { template diff --git a/src/search/search_thread.h b/src/search/search_thread.h index 9d571b3..3a237e3 100644 --- a/src/search/search_thread.h +++ b/src/search/search_thread.h @@ -360,6 +360,8 @@ namespace search { while (!move_list.empty()) { core::Move move = move_list.next_move(); + if (alpha > -WORST_MATE && !see(board, move, 0)) continue; + shared.node_count++; board.make_move(move, &nnue); Score score = -qsearch(-beta, -alpha); diff --git a/src/search/see.h b/src/search/see.h index 3f7ffd6..0eaa474 100644 --- a/src/search/see.h +++ b/src/search/see.h @@ -61,7 +61,7 @@ namespace search { stm = color_enemy(stm); if (value >= 0) { - if (type == KING && (attackers & board.pieces(stm))) { + if (type == KING && (attackers & board.sides(stm))) { stm = color_enemy(stm); } break;