Unbreak find_nonstupid_moves.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 21 Nov 2013 22:13:45 +0000 (23:13 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 21 Nov 2013 22:13:45 +0000 (23:13 +0100)
www/js/remoteglot.js

index 80a5db9..d259e27 100644 (file)
@@ -261,7 +261,7 @@ var find_nonstupid_moves = function(data, margin) {
                        moves.push(move);
                }
        }
-       moves = moves.sort(function(a, b) { return compare_by_score(data.refutation_lines, a, b) });
+       moves = moves.sort(function(a, b) { return compare_by_score(data.refutation_lines, data.position.toplay, a, b) });
        moves.unshift(data.pv_uci[0]);
 
        return moves;