]> git.sesse.net Git - remoteglot-book/commitdiff
Fix number-of-moves display in root PGN.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Dec 2014 10:39:18 +0000 (11:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Dec 2014 10:39:18 +0000 (11:39 +0100)
www/opening-stats.pl

index edbff24e3303cb103ae85b2201576cede343f70c..3affdd524ac2d72a1964719a9dcd66dc0320689d 100755 (executable)
@@ -53,7 +53,7 @@ eval {
        $root_game->{'date'} = $pgn->date;
        $root_game->{'result'} = $pgn->result;
        $root_game->{'eco'} = $pgn->eco;
-       $root_game->{'moves'} = scalar @{$pgn->moves};
+       $root_game->{'moves'} = int(((scalar @{$pgn->moves}) + 1) / 2);
 };
 
 # Explore one move out.