Closed PLMMJ-FH closed 1 week ago
This was already fixed via https://github.com/gbtami/pychess-variants/commit/ba285a4fbb418e3623c02f8d0fc0d965188fc7b2 but it was not deployed yet. Premoves are implemented in https://github.com/gbtami/chessgroundx/blob/master/src/premove.ts but I completely forget about adding Shatranj before. Now it is there.
You seem to have only fixed it for Shatranj, it is still a thing in S-Chess at least
Duck Chess is even worse. For some reason, the King still appears to be able to capture the kingside rook despite it obviously not being unmoved.
This is by design. Premove targets are NOT just valid move targets only. They are created from piece movement rules only without checking all of the other game rules. The is because opponent next move can change which our next move will be possible or not possible in different variants. For example in atomic pieces can vanish when opp player takes something. Screenshot from lichess
When premoving, the King looks to be able to capture the Rook's location. However, selecting this premove does nothing.
This also occurs in Shatranj (I was going to put this in #1684 until discovering it happens in chess too):
I have no idea what is going on here but it seems too obvious to be a bug.