bugfix - to short version - skipping comment moves
This commit is contained in:
@@ -202,20 +202,24 @@ class PgnParser
|
|||||||
private function toShortVersion($branch)
|
private function toShortVersion($branch)
|
||||||
{
|
{
|
||||||
foreach ($branch as &$move) {
|
foreach ($branch as &$move) {
|
||||||
$move["n"] = $move["from"] . $move["to"];
|
|
||||||
|
|
||||||
#$move["n"] = $move["from"] . $move["to"];
|
if (isset($move["from"])) {
|
||||||
#unset($move["m"]);
|
$move["n"] = $move["from"] . $move["to"];
|
||||||
unset($move["fen"]);
|
|
||||||
unset($move["from"]);
|
#$move["n"] = $move["from"] . $move["to"];
|
||||||
unset($move["to"]);
|
#unset($move["m"]);
|
||||||
if (isset($move["variations"])) {
|
unset($move["fen"]);
|
||||||
$move["v"] = array();
|
unset($move["from"]);
|
||||||
foreach ($move["variations"] as $variation) {
|
unset($move["to"]);
|
||||||
$move["v"][] = $this->toShortVersion($variation);
|
if (isset($move["variations"])) {
|
||||||
|
$move["v"] = array();
|
||||||
|
foreach ($move["variations"] as $variation) {
|
||||||
|
$move["v"][] = $this->toShortVersion($variation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
unset($move["variations"]);
|
||||||
}
|
}
|
||||||
unset($move["variations"]);
|
|
||||||
}
|
}
|
||||||
return $branch;
|
return $branch;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user