From 1de1262c396a5bd2527a660272765d6e102d6c83 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Thu, 1 Oct 2020 02:54:44 +0900 Subject: [PATCH] Fix #765 (handicap bug in #758) --- src/main/java/featurecat/lizzie/rules/SGFParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/featurecat/lizzie/rules/SGFParser.java b/src/main/java/featurecat/lizzie/rules/SGFParser.java index 3456339ec..3cc146e50 100644 --- a/src/main/java/featurecat/lizzie/rules/SGFParser.java +++ b/src/main/java/featurecat/lizzie/rules/SGFParser.java @@ -121,7 +121,8 @@ private static boolean parse(String value) { Lizzie.leelaz.supportScoremean = false; } - // Detach engine for avoiding useless "play" and "undo" (#752). + // Detach engine for avoiding useless "play" and "undo" (#752) + // except for handicap stones in parseValue() (#765). Lizzie.leelaz.isAttached = false; parseValue(value, null, false); Lizzie.leelaz.isAttached = true; @@ -347,6 +348,8 @@ private static BoardHistoryList parseValue( } } } else { + // Setting handicap stones. We need to send "play" to the engine here. + Lizzie.leelaz.isAttached = true; if (move == null) { if (history == null) { Lizzie.board.pass(color); @@ -365,6 +368,7 @@ private static BoardHistoryList parseValue( } else { history.flatten(); } + Lizzie.leelaz.isAttached = false; } } else if (tag.equals("PB")) { blackPlayer = tagContent;