From 7c6a38a7769ee8fb152467e69842edec96d670ab Mon Sep 17 00:00:00 2001 From: salmi younes Date: Wed, 9 Apr 2025 22:15:16 +0100 Subject: [PATCH] Fix checkmate bug (#7) --- src/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.c b/src/search.c index af47b40..5cec4e4 100644 --- a/src/search.c +++ b/src/search.c @@ -141,7 +141,7 @@ int alpha_beta(Search *search, Board *board, int depth, int ply, int alpha, int int root_search(Search *search, Board *board, int depth, int ply, int alpha, int beta, Move *result) { Undo undo; Move moves[MAX_MOVES]; - int count = gen_moves(board, moves); + int count = gen_legal_moves(board, moves); sort_moves(search, board, moves, count); Move *best = NULL; for (int i = 0; i < count; i++) {