fixed condition

This commit is contained in:
Karma Riuk 2025-02-03 13:49:40 +01:00
parent 6478176a7d
commit 58109c5120

View File

@ -296,11 +296,10 @@ bool Board::is_check_for(int8_t colour) const {
bool Board::no_legal_moves_for(int8_t colour) const { bool Board::no_legal_moves_for(int8_t colour) const {
for (int i = 0; i < 64; i++) { for (int i = 0; i < 64; i++) {
if ((colour_at(i) == White && white_to_play) if (colour_at(i) == colour) {
|| (colour_at(i) == Black && !white_to_play)) { std::vector<Move> moves =
if (legal_moves(squares[i] & 0b111, *this, Coords::from_index(i)) legal_moves(squares[i], *this, Coords::from_index(i));
.size() if (moves.size() > 0)
> 0)
return false; return false;
} }
} }