From 00137e022a4b98f6c7b238d1a6fb23dfc3211638 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Mon, 3 Feb 2025 14:04:27 +0100 Subject: [PATCH] fixed move for position initial guard --- cpp/src/pieces/piece.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/pieces/piece.cpp b/cpp/src/pieces/piece.cpp index 0ccdc94..10af85a 100644 --- a/cpp/src/pieces/piece.cpp +++ b/cpp/src/pieces/piece.cpp @@ -44,15 +44,15 @@ legal_moves(int8_t p, const Board& b, const Coords xy, bool looking_for_check) { break; } - if (!looking_for_check) - return keep_only_blocking(ret, b); + // if (!looking_for_check) + // return keep_only_blocking(ret, b); - return {}; + return ret; } std::optional move_for_position(const Board& board, const Coords source, const Coords dest) { - if (dest.is_within_bounds()) + if (!dest.is_within_bounds()) return {}; int8_t piece = board.squares[dest.to_index()];