From 1fa13bbe3bcd2ab9bf6f4bbdfc4f8aaa1c047688 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Sun, 22 Feb 2026 16:41:17 -0500 Subject: [PATCH] Play pair sound before element check and add pair detection debug log Sound was gated behind element check which may fail during swap animation when card DOM elements are replaced by overlays. Co-Authored-By: Claude Opus 4.6 --- client/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/app.js b/client/app.js index 214bda4..ee46149 100644 --- a/client/app.js +++ b/client/app.js @@ -2592,6 +2592,7 @@ class GolfGame { if (!wasPaired && nowPaired) { // New pair formed! + console.log('[PAIR] New pair detected for', newPlayer.name, 'col', top, bottom, 'isLocal:', newPlayer.id === this.playerId); setTimeout(() => { this.firePairCelebration(newPlayer.id, top, bottom); }, window.TIMING?.celebration?.pairDelay || 50); @@ -2607,10 +2608,10 @@ class GolfGame { } firePairCelebration(playerId, pos1, pos2) { + this.playSound('pair'); const elements = this.getCardElements(playerId, pos1, pos2); if (elements.length < 2) return; - this.playSound('pair'); if (window.cardAnimations) { window.cardAnimations.celebratePair(elements[0], elements[1]); }