Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #765 (handicap bug in #758) #766

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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