ChessCom / Chess-Game

Based on Pear Games_Chess - represents a chess game as a php object
Other
42 stars 20 forks source link

Argument $from is ignored in method moveSAN #4

Closed borro closed 11 years ago

borro commented 11 years ago

_parseMove ignores $from, so do not correctly handle taking on pass.

Example:

$game = new ChessGameEngine();
$game->resetGame();
$game->moveSAN('c3', 'b1');
echo $game->renderFen();

Output:

rnbqkbnr/pppppppp/8/8/8/2N5/PPPPPPPP/R1BQKBNR b KQkq c2 1 1

https://github.com/ChessCom/Chess-Game/blob/master/library/ChessGame.php#L927

borro commented 11 years ago

My mistake. It is necessary to use a method moveSquare.