-
- // Truncate PV at the start if needed.
- let start_display_move_num = display_line.start_display_move_num;
- if (start_display_move_num > 0) {
- pv = pv.slice(start_display_move_num);
- let to_add = start_display_move_num;
- if (toplay === 'b') {
- ++move_num;
- toplay = 'w';
- --to_add;
- }
- if (to_add % 2 == 1) {
- toplay = 'b';
- --to_add;
- }
- move_num += to_add / 2;
- if (splicepos !== null && splicepos > 0) {
- --splicepos;
- }
- }