Skip to content

Commit

Permalink
Allow to play the very first move sound
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Oct 3, 2024
1 parent ab0fd1b commit 249513e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/roundCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ export class RoundController extends GameController {
const piece = this.chessground.state.boardState.pieces.get(lastMove[1] as cg.Key);
capture = (piece !== undefined && piece.role !== '_-piece' && step.san?.slice(0, 2) !== 'O-') || (step.san?.slice(1, 2) === 'x');
}
if (msg.steps.length === 1 && lastMove && (this.turnColor === this.mycolor || this.spectator)) {
if (msg.steps.length <= 2 && lastMove && (this.turnColor === this.mycolor || this.spectator)) {
if (!this.finishedGame) sound.moveSound(this.variant, capture);
}
this.checkStatus(msg);
Expand Down

0 comments on commit 249513e

Please sign in to comment.