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)
// Verify the move is valid first
found := false
// Find the move and get its algebraic notation
var algebraicMove string
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
algebraicMove = move.String()
break
}
}
if !found {
if algebraicMove == "" {
return result
}
// 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 {
// Make the move using algebraic notation
if err := game.PushMove(algebraicMove); err != nil {
return result
}