lichess-org / lichobile

lichess.org mobile application
https://lichess.org/mobile
GNU General Public License v3.0
2.03k stars 318 forks source link

castling not correct implemented on iOS #1932

Open ajay-gh opened 2 years ago

ajay-gh commented 2 years ago

Describe the bug Let me start like this - I know the rules. Assume that castling was blocked at some point in the game, e.g. by an attack on a square between the king and the rook. A little later this field is no longer attacked, and all other requirements for castling are met (as per https://en.wikipedia.org/wiki/Castling#Requirements). In this case on iOS, may be other systems, the castling is blocked in Lichess.

To Reproduce Create a situation as described before - in a real game.

Expected behavior Correct implementation of the rules.

Screenshots Not available.

Smartphone (please complete the following information):

Additional context n/a

jas14 commented 2 years ago

@ajay-gh thanks for the report - we've had many reports of issues with castling while playing against the CPU offline, but none with a live game. Can you provide some more information, such as:

ajay-gh commented 2 years ago

Hello jas, Let me add that my issue affects online and offline games - but the game has to be run without using the board editor. As per bullets 2 and 4, I will try to report this. It may take a few days to get the data as the problem cannot be forced (again no board editor). Bullet 3 - video, I don't think I have the resources to do this consistently, without harming other applications on this iPad. Finally, I am not familiar with the tum/ply numbers - where do I find them AND can I find them after the problem has occurred ?

ajay-gh commented 2 years ago

Finally I can provide proof for the problem. The situation: a normal online game, no prior takebacks (accepted or not). Unfortunately I do not have the complete PNG, but the screenshot shows that castling was permitted by the app while one of the squares between the black king and rook was under attack. That the castling was the last move is shown by the green highlight in the picture.

IMG_1634

veloce commented 2 years ago

This last screenshot shows a situation that doesn't break the chess rules: castling here was permitted because the square attacked by the bishop is b8, this is not a square traversed by the king during the castling move. Here only an attack on c8 or d8 would have prevented castling. Check the rules again. Thanks!