jrwats / bughouse.app

Bughouse Chess
GNU General Public License v3.0
1 stars 1 forks source link

Queen couldn't capure? #31

Closed jrwats closed 3 years ago

jrwats commented 3 years ago

https://bughouse.app/analysis/1lZBQb5TI42gJY-UgPDU-K

Debug this ^^^ Queen couldn't capture pawn.

jrwats commented 3 years ago

Played a duplicate game and I could move the queen.

I think the Esteban refreshed, and hit the bug where the server thought the player was not in a game. Fixed by: https://github.com/jrwats/bughouse.app/commit/9c72cb131e634e55e3b11e539e865d9c4f3f48da

jrwats commented 3 years ago

OK, finally figured out what was going on. Refreshing is essentially busted, as we can render the chessground before confirming the viewer is playing. Changing the viewOnly was never going to work as expected because of https://github.com/ornicar/chessground/blob/404799d4400e487665d7c47d44475dedbf28cc84/src/api.ts#L12-L13

So I updated https://github.com/jrwats/react-chessground to workaround this https://github.com/jrwats/react-chessground/blob/master/src/chessground.js#L67-L71