Skip to content

Commit

Permalink
Merge pull request featurecat#766 from kaorahi/fix765_handicap
Browse files Browse the repository at this point in the history
Fix featurecat#765 (handicap bug in featurecat#758)
  • Loading branch information
featurecat authored Sep 30, 2020
2 parents bff3470 + 1de1262 commit ebeb446
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 ebeb446

Please sign in to comment.