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

This commit is contained in:
doomtube 2026-01-08 01:23:04 -05:00
parent e704a1e1c4
commit 32a19f24ea

View file

@ -736,8 +736,8 @@ func validateChessMove(fenStr, from, to, promotion string) MoveResult {
game := chess.NewGame(fen) game := chess.NewGame(fen)
// Find the move in valid moves // Find and execute the move
found := false var validMove *chess.Move
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 validMove = &move
break break
} }
} }
if !found { if validMove == nil {
return result return result
} }
// Make the move using MoveStr (UCI format) // Make the move
moveStr := from + to if err := game.Move(validMove); err != nil {
if promotion != "" {
moveStr += promotion
}
if err := game.MoveStr(moveStr); err != nil {
return result return result
} }