lichess-org / chessground

Mobile/Web chess UI for lichess.org
https://lichess.org
GNU General Public License v3.0
1.04k stars 261 forks source link

Likely bug with chessground.set(options) #15

Closed bglusman closed 9 years ago

bglusman commented 9 years ago

Unless I'm misunderstanding the docs, I should be able to call chessground.set({turnColor: 'white'}) on black's turn, and black will no longer be able to drag pieces, and white will, correct?

I'm trying to do this in a toy bughouse implementation I'm working on (after I've added a dropped piece programmatically), and black remains the color in control, though it breaks the actual move completion, so either I'm doing it wrong, or that command is setting the board to an inconsistent state where only part of the board understand's which color is next to move. Let me know if you need any more details or have trouble reproducing etc!

ornicar commented 9 years ago

http://jsfiddle.net/aujedo35/

movable.color and turnColor are distinct, as to allow various scenarios like board editing or premoving.