fixes lol
Some checks failed
Build and Push / build-all (push) Failing after 54s

This commit is contained in:
doomtube 2026-01-08 01:43:00 -05:00
parent 07ef81c4c8
commit 7916294943

View file

@ -736,8 +736,8 @@ func validateChessMove(fenStr, from, to, promotion string) MoveResult {
game := chess.NewGame(fen) game := chess.NewGame(fen)
// Verify the move is valid first // Find the move and get its algebraic notation
found := false var algebraicMove string
for _, move := range game.ValidMoves() { for _, move := range game.ValidMoves() {
if move.S1().String() == from && move.S2().String() == to { if move.S1().String() == from && move.S2().String() == to {
// Check promotion // Check promotion
@ -748,21 +748,17 @@ func validateChessMove(fenStr, from, to, promotion string) MoveResult {
continue continue
} }
} }
found = true algebraicMove = move.String()
break break
} }
} }
if !found { if algebraicMove == "" {
return result return result
} }
// Make the move using UCI notation (e.g., "e2e4" or "e7e8q" for promotion) // Make the move using algebraic notation
uciMove := from + to if err := game.PushMove(algebraicMove); err != nil {
if promotion != "" {
uciMove += promotion
}
if err := game.PushNotationMove(uciMove, chess.UCINotation{}, nil); err != nil {
return result return result
} }