From 8cdb6b99332b57bbc67758095cd740836060a015 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 12 Aug 2026 09:06:44 +0200 Subject: fixing --- src/moves.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/moves.cpp') diff --git a/src/moves.cpp b/src/moves.cpp index b7b1688..812e734 100644 --- a/src/moves.cpp +++ b/src/moves.cpp @@ -114,7 +114,7 @@ void GeneratePawnMoves(Game *b, int from, std::vector &moves, int twoSteps = from + (step * 2); if (position.rank == startingRank && b->pieces[twoSteps].type == NONEPIECE) { - moves.push_back({position, IndexToPosition(twoSteps)}); + moves.push_back({.From = position, .To = IndexToPosition(twoSteps)}); } }; @@ -155,7 +155,6 @@ void GeneratePawnMoves(Game *b, int from, std::vector &moves, }); } else { moves.push_back({.From = position, .To = IndexToPosition(target)}); - moves.push_back({.From = position, .To = IndexToPosition(target)}); } } } @@ -188,7 +187,8 @@ void GenerateKingMoves(Game *g, int from, std::vector &moves, continue; } - moves.push_back({IndexToPosition(from), IndexToPosition(next)}); + moves.push_back( + {.From = IndexToPosition(from), .To = IndexToPosition(next)}); } }; @@ -251,8 +251,9 @@ bool IsSquareAttacked(Game *g, Position square, bool byColor) { continue; Piece p = g->pieces[pawnRank * 8 + file]; - if (p.type == PAWN && p.color == byColor) + if (p.type == PAWN && p.color == byColor) { return true; + } } } -- cgit v1.2.3