dev: Added QS/KS castle checking; simplified moveList pruning
This commit is contained in:
parent
e42457d3ab
commit
78749a6af2
2 changed files with 18 additions and 7 deletions
|
|
@ -126,10 +126,9 @@ std::vector<Move> King::getLegalMoves(const Square &from, const Board &board) co
|
|||
// will this actually work?
|
||||
moveList.erase(
|
||||
std::remove_if(moveList.begin(), moveList.end(),
|
||||
[&](const Square &x) {
|
||||
return std::find(x.begin(), x.end(), !x.isValid()) != x.end();
|
||||
}),
|
||||
moveList.end());
|
||||
[&](const auto &x) {
|
||||
return !x.to.isValid();
|
||||
}));
|
||||
return moveList;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue