ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
20 stars 5 forks source link

Wrong animation when a king moves into a castling square without castling #47

Closed DivineWinds closed 3 months ago

DivineWinds commented 6 months ago

So, chmess is this trivial variant where the king moves over two squares instead of one. When I tried to play this on fairyground, I noticed that playing Kg1/8 or Kc1/8 when the corresponding rook hasn't moved will move the rook as if I had castled for a split second before putting it back on its home square. I couldn't get the effect to happen consistently if castling was illegal but I think that if castling in the direction of the move is legal, the effect will reliably trigger.

For completeness, this is what I added to the variants.ini I imported:

[chmess:fischerandom]
king=k:K2

EDIT: I just realised that the author might have intended the king's move to be nDnA instead. That's irrelevant to the issue, but I felt the need to say it. The same bug happens if you use that move too.

https://github.com/ianfab/fairyground/assets/110789012/9ea3bced-9acc-451f-8ed3-923cb584b3e0

ianfab commented 6 months ago

@gbtami I assume this is behavior inherent to chessgroundx when the king moves multiple squares or something like that, right?

gbtami commented 6 months ago

Yes. Probably usingautoCastle: false in chessground config can solve it.