Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.1

Bug #13026 En Passant whilst in check
Submitted: 2008-01-31 17:48 UTC
From: cubehouse Assigned:
Status: Open Package: Games_Chess (version 1.0.1)
PHP Version: 5.2.5 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-01-31 17:48 UTC] cubehouse (James Holding)
Description: ------------ It seems that en passsant is not allowed when in check, even when it can be used to get out of check. Test script: --------------- PGN of example game that was counted as checkmate: http://facebook.chess.com/pgn.php?gid=1000861 Expected result: ---------------- Game should have allowed en passant to get out of checkmate Actual result: -------------- Game was counted as a win for white

Comments

 [2008-02-01 03:07 UTC] cellog (Greg Beaver)
so you guys are using Games_Chess? I have been playing chess on facebook for a while not knowing it was running my code, how weird :). I'll take a look when I get a chance. It's a relatively rare bug, but if you are inclined to look into it, the place to patch is probably in Games/Chess/Standard.php, method _interposeOrCapture(). The problem is most likely that _enPassantSquare needs to be set when iterating through the possible moves to see if any get out of check. It looks like getPossiblePawnMoves() is not aware that it can capture en passant.
 [2008-02-01 08:32 UTC] cubehouse (James Holding)
ok, I'll see if I can work out whats going on... not sure if I'll be able to. And yeh, we've been using Games_Chess for a while now. We had an old chess rules system that didn't understand half the checkmates when through a bishop etc... this is literally the first bug we've found. Although I usually get at least one email every day from someone complaining their pawn was taken unusually and I have to explain en passant. Thanks alot
 [2008-05-11 20:44 UTC] goran1 (Göran Joelsson)
Example of a game with the same problem as reported earlier. Please check PGN here: http://fb.chess.com/pgn.php?gid=3667325 BR, Göran