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)
// Find the move in valid moves
found := false
// Find and execute the move
var validMove *chess.Move
for _, move := range game.ValidMoves() {
if move.S1().String() == from && move.S2().String() == to {
// Check promotion
@ -748,21 +748,17 @@ func validateChessMove(fenStr, from, to, promotion string) MoveResult {
continue
}
}
found = true
validMove = &move
break
}
}
if !found {
if validMove == nil {
return result
}
// Make the move using MoveStr (UCI format)
moveStr := from + to
if promotion != "" {
moveStr += promotion
}
if err := game.MoveStr(moveStr); err != nil {
// Make the move
if err := game.Move(validMove); err != nil {
return result
}