aboutsummaryrefslogtreecommitdiff
path: root/src/moves.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-27 18:57:09 +0200
committerAdam <adammegarules1@gmail.com>2026-07-27 18:57:09 +0200
commitf1ded0290393709d437c6e149861ceb91d241c64 (patch)
tree65a1174204ee1914bf1c849c60ec8f798b8c840f /src/moves.cpp
parent322e745ef6078be6c6016cf4d2b0186c97d8a435 (diff)
fixing king captuare bug
Diffstat (limited to 'src/moves.cpp')
-rw-r--r--src/moves.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/moves.cpp b/src/moves.cpp
index 81ea1df..9c7991a 100644
--- a/src/moves.cpp
+++ b/src/moves.cpp
@@ -130,7 +130,6 @@ std::vector<Move> GetLegalMoves(Board *b) {
bool isLegal = true;
Board testBoard = *b;
PlayMove(move, &testBoard);
- testBoard.turn = !testBoard.turn;
auto opponentResponse = GetPseudoLegalMoves(&testBoard);
for (Move move : opponentResponse) {
if (testBoard.pieces[PositionToIndex(move.To)].type == KING) {
@@ -145,7 +144,6 @@ std::vector<Move> GetLegalMoves(Board *b) {
bool isCheck = false;
Board testBoard = *b;
- testBoard.turn = !testBoard.turn;
auto opponentResponse = GetPseudoLegalMoves(&testBoard);
for (Move move : opponentResponse) {
if (testBoard.pieces[PositionToIndex(move.To)].type == KING) {