From 2419916abd9aa479ddd1687f3b496d4c7244d484 Mon Sep 17 00:00:00 2001 From: Sander Land Date: Fri, 14 Feb 2020 18:51:32 +0100 Subject: [PATCH] update parent analysis if top move is played -- should lead to less frustration with hints not matching result --- board.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board.py b/board.py index e52a5cb..848c65a 100644 --- a/board.py +++ b/board.py @@ -56,6 +56,10 @@ class Move: else: self.analysis = analysis_blob["moveInfos"] self.ownership = analysis_blob["ownership"] + if self.parent and self.parent.analysis and self.parent.analysis[0]["move"] == self.gtp(): + self.parent.analysis[0]["scoreLead"] = self.analysis[0]["scoreLead"] + if self.children and self.children[0].analysis and self.children[0].gtp() == self.analysis[0]["move"]: + self.analysis[0]["scoreLead"] = self.children[0].analysis[0]["scoreLead"] # if received out of order, some edge case with undos ignored @property def analysis_ready(self):