@@ -19,36 +19,35 @@ module.exports = function(opts) {
19
19
var rcolor = color === 'white' ? 'black' : 'white' ;
20
20
if ( hovering && hovering . fen === n . fen ) shapes = shapes . concat ( makeAutoShapesFromUci ( color , hovering . uci , 'paleBlue' ) ) ;
21
21
if ( opts . vm . showAutoShapes ( ) && opts . vm . showComputer ( ) ) {
22
- if ( n . eval && n . eval . best )
23
- shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . eval . best , 'paleGreen' ) ) ;
22
+ if ( n . eval ) shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . eval . best , 'paleGreen' ) ) ;
24
23
if ( ! hovering ) {
25
24
var nextBest = opts . nextNodeBest ( ) ;
26
- if ( ! nextBest && opts . ceval . enabled ( ) && n . ceval && n . ceval . best ) nextBest = n . ceval . best ;
25
+ if ( ! nextBest && opts . ceval . enabled ( ) && n . ceval ) nextBest = n . ceval . moves [ 0 ] ;
27
26
if ( nextBest ) shapes = shapes . concat ( makeAutoShapesFromUci ( color , nextBest , 'paleBlue' ) ) ;
28
27
if ( opts . ceval . enabled ( ) && n . ceval && n . ceval . pvs && n . ceval . pvs [ 1 ] && ! ( opts . vm . threatMode && n . threat && n . threat . pvs && n . threat . pvs [ 2 ] ) ) {
29
28
n . ceval . pvs . forEach ( function ( pv ) {
30
- if ( pv . best === nextBest ) return ;
29
+ if ( pv . moves [ 0 ] === nextBest ) return ;
31
30
var shift = winningChances . povDiff ( color , n . ceval . pvs [ 0 ] , pv ) ;
32
31
if ( shift > 0.2 || isNaN ( shift ) || shift < 0 ) return ;
33
- shapes = shapes . concat ( makeAutoShapesFromUci ( color , pv . best , 'paleGrey' , {
32
+ shapes = shapes . concat ( makeAutoShapesFromUci ( color , pv . moves [ 0 ] , 'paleGrey' , {
34
33
lineWidth : Math . round ( 12 - shift * 50 ) // 12 to 2
35
34
} ) ) ;
36
35
} ) ;
37
36
}
38
37
}
39
38
}
40
- if ( opts . ceval . enabled ( ) && opts . vm . threatMode && n . threat && n . threat . best ) {
39
+ if ( opts . ceval . enabled ( ) && opts . vm . threatMode && n . threat && n . threat . moves [ 0 ] ) {
41
40
if ( n . threat . pvs [ 1 ] ) {
42
- shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . threat . best , 'paleRed' ) ) ;
41
+ shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . threat . moves [ 0 ] , 'paleRed' ) ) ;
43
42
n . threat . pvs . slice ( 1 ) . forEach ( function ( pv ) {
44
43
var shift = winningChances . povDiff ( rcolor , pv , n . threat . pvs [ 0 ] ) ;
45
44
if ( shift > 0.2 || isNaN ( shift ) || shift < 0 ) return ;
46
- shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , pv . best , 'paleRed' , {
45
+ shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , pv . moves [ 0 ] , 'paleRed' , {
47
46
lineWidth : Math . round ( 11 - shift * 45 ) // 11 to 2
48
47
} ) ) ;
49
48
} ) ;
50
49
} else
51
- shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . threat . best , 'red' ) ) ;
50
+ shapes = shapes . concat ( makeAutoShapesFromUci ( rcolor , n . threat . moves [ 0 ] , 'red' ) ) ;
52
51
}
53
52
return shapes ;
54
53
} ;
0 commit comments