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

This commit is contained in:
doomtube 2026-01-08 01:31:04 -05:00
parent 9984ab49fb
commit 07ef81c4c8

View file

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