Skip to content

Commit

Permalink
Backfill piece type for submitted moves
Browse files Browse the repository at this point in the history
  • Loading branch information
thijzert committed Sep 1, 2021
1 parent db5d2ef commit db22118
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/web-plumbing/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ func (w webProvider) SubmitMove(mov chesseract.Move) error {
return err
}

if piece, ok := g.Match.Board.At(mov.From); ok {
mov.PieceType = piece.PieceType
}

newb, err := g.Match.RuleSet.ApplyMove(g.Match.Board, mov)
if err != nil {
return client.ErrIllegalMove
Expand Down

0 comments on commit db22118

Please sign in to comment.