Skip to content

Commit

Permalink
Merge #667
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Sep 28, 2020
2 parents 2cafbc4 + bc978ef commit 9cd06f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/featurecat/lizzie/rules/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,11 @@ public void saveMoveNumber() {
/** Save the back routing from children */
public void saveBackRouting(BoardHistoryNode node) {
Optional<BoardHistoryNode> prev = node.previous();
prev.ifPresent(n -> n.setFromBackChildren(n.getVariations().indexOf(node)));
prev.ifPresent(n -> n.previous().ifPresent(p -> saveBackRouting(p)));
prev.ifPresent(
n -> {
n.setFromBackChildren(n.getVariations().indexOf(node));
saveBackRouting(n);
});
}

/** Restore move number by saved node */
Expand Down

0 comments on commit 9cd06f6

Please sign in to comment.