Skip to content

Commit 0e28859

Browse files
feat: only update sf eval if depth is greater than existing analysis
1 parent 0a75420 commit 0e28859

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/types/base/tree.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@ export class GameNode {
411411
stockfishEval: StockfishEvaluation,
412412
activeModel?: string,
413413
): void {
414+
if (
415+
this._analysis.stockfish &&
416+
this._analysis.stockfish.depth >= stockfishEval.depth
417+
) {
418+
return
419+
}
420+
414421
this._analysis.stockfish = stockfishEval
415422

416423
if (stockfishEval.depth >= 12) {
@@ -422,7 +429,6 @@ export class GameNode {
422429
stockfishEval,
423430
activeModel,
424431
)
425-
// Set color for existing children based on new analysis
426432
child._color = calculateMoveColor(stockfishEval, child.move)
427433
}
428434
}

0 commit comments

Comments
 (0)