Always set En passant square when pawn moves to squares

This commit is contained in:
DHTMLGoodies
2016-01-12 22:07:49 +01:00
parent 3ec671f536
commit fd4147d036
2 changed files with 69 additions and 9 deletions

View File

@@ -1510,12 +1510,10 @@ class FenParser0x88
}
if (($move['from'] & 15) == ($move['to'] & 15) && $this->getDistance($move['from'], $move['to']) == 2) {
if ($this->cache['board'][$move['to'] - 1] || $this->cache['board'][$move['to'] + 1]) {
if ($color === 'white') {
$enPassant = Board0x88Config::$numberToSquareMapping[$move['from'] + 16];
} else {
$enPassant = Board0x88Config::$numberToSquareMapping[$move['from'] - 16];
}
if ($color === 'white') {
$enPassant = Board0x88Config::$numberToSquareMapping[$move['from'] + 16];
} else {
$enPassant = Board0x88Config::$numberToSquareMapping[$move['from'] - 16];
}
}
}