Skip to content

Commit

Permalink
Fix featurecat#765 (handicap bug in featurecat#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Sep 30, 2020
1 parent a1a6ff3 commit 1de1262
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/featurecat/lizzie/rules/SGFParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -365,6 +368,7 @@ private static BoardHistoryList parseValue(
} else {
history.flatten();
}
Lizzie.leelaz.isAttached = false;
}
} else if (tag.equals("PB")) {
blackPlayer = tagContent;
Expand Down

0 comments on commit 1de1262

Please sign in to comment.