Chess on the ATmosphere checkmate.blue
chess
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix rollback losing opponent move and rematch not swapping colors

+5 -2
+5 -2
src/routes/game/[did]/[rkey]/+page.svelte
··· 340 340 341 341 const pgn = record.pgn as string; 342 342 if (pgn && game.applyOpponentMove(pgn)) { 343 + lastPersistedPgn = pgn; 343 344 sound.play('notify'); 344 345 } 345 346 ··· 574 575 rematchCreating = true; 575 576 try { 576 577 const opponentDid = game.myColor === 'white' ? game.blackDid : game.whiteDid; 578 + const newWhite = game.myColor === 'white' ? opponentDid : auth.did; 579 + const newBlack = game.myColor === 'white' ? auth.did : opponentDid; 577 580 const isVariant = game.startingFen != null; 578 581 const result = await createGame(auth.agent, { 579 - white: opponentDid, 580 - black: auth.did, 582 + white: newWhite, 583 + black: newBlack, 581 584 status: 'waiting', 582 585 variant: isVariant ? 'really-bad-chess' : undefined, 583 586 pgn: isVariant ? makeInitialPgn(generateRandomFen(), 'Really Bad Chess') : undefined,