Skip to content

Commit

Permalink
Merge pull request #288 from kaorahi/ctrlc-sideeffect
Browse files Browse the repository at this point in the history
Fix: suggestion appears on a existing stone after Ctrl-C
  • Loading branch information
featurecat authored Jun 11, 2018
2 parents 375a5cd + 8eb4b32 commit 29334dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/java/featurecat/lizzie/rules/BoardHistoryList.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ public void setGameInfo(GameInfo gameInfo) {
this.gameInfo = gameInfo;
}

public BoardHistoryList shallowCopy() {
BoardHistoryList copy = new BoardHistoryList(null);
copy.head = head;
copy.gameInfo = gameInfo;
return copy;
}

/**
* Clear history.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/featurecat/lizzie/rules/SGFParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static void save(Board board, String filename) throws IOException {

private static void saveToStream(Board board, Writer writer) throws IOException {
// collect game info
BoardHistoryList history = board.getHistory();
BoardHistoryList history = board.getHistory().shallowCopy();
GameInfo gameInfo = history.getGameInfo();
String playerBlack = gameInfo.getPlayerBlack();
String playerWhite = gameInfo.getPlayerWhite();
Expand Down

0 comments on commit 29334dd

Please sign in to comment.