From 07ef81c4c8d71da126305c947a3b45d7135b8403 Mon Sep 17 00:00:00 2001 From: doomtube Date: Thu, 8 Jan 2026 01:31:04 -0500 Subject: [PATCH] fixes lol --- nakama/go-modules/main.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nakama/go-modules/main.go b/nakama/go-modules/main.go index 1cb555f..ef79c56 100644 --- a/nakama/go-modules/main.go +++ b/nakama/go-modules/main.go @@ -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 }