Skip to content

Commit

Permalink
add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Manukyanq committed Jul 16, 2023
1 parent a6ce7d0 commit 6025676
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/chess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ export class Chess {

const currentPieceOnSquare = this._board[sq]

// if one of the kings will be replaced by the piece from args, set the `_kings` respective entry to `EMPTY`
if (currentPieceOnSquare && currentPieceOnSquare.type === KING) {
this._kings[currentPieceOnSquare.color] = EMPTY
}
Expand Down

0 comments on commit 6025676

Please sign in to comment.