Bugfixes + support for getting shorter parsing format

This commit is contained in:
DHTMLGoodies
2017-08-17 13:53:35 +02:00
parent 9490f2cd09
commit 68d6e084c9
7 changed files with 185 additions and 18 deletions

View File

@@ -1443,12 +1443,13 @@ class FenParser0x88
if (is_string($move) && strlen($move) == 4) {
$move = $this->getFromAndToByLongNotation($move);
} else if (is_string($move)) {
$move = $this->getFromAndToByNotation($move);
}
if(!$this->canMoveFromTo($move["from"], $move["to"])){
throw new FenParser0x88Exception("Invalid move " . json_encode($move));
throw new FenParser0x88Exception("Invalid move " . $this->getColor() . " - " . json_encode($move));
}
$this->fen = null;
@@ -1477,9 +1478,7 @@ class FenParser0x88
if(empty($validMoves[$from]) || !in_array($to, $validMoves[$from])){
return false;
}
return true;
}
function setNewColor()