diff --git a/src/main/java/featurecat/lizzie/rules/Board.java b/src/main/java/featurecat/lizzie/rules/Board.java index 10dc4062b..8239be7ff 100644 --- a/src/main/java/featurecat/lizzie/rules/Board.java +++ b/src/main/java/featurecat/lizzie/rules/Board.java @@ -519,9 +519,12 @@ public void place(int x, int y, Stone color, boolean newBranch, boolean changeMo Stone[] stones = history.getStones().clone(); Zobrist zobrist = history.getZobrist(); Optional lastMove = Optional.of(new int[] {x, y}); + boolean isNewSubBranch = + newBranch && (history.getCurrentHistoryNode().numberOfChildren() > 0); + boolean isMissingMoveMNNumber = history.getMoveMNNumber() < 0; int moveNumber = history.getMoveNumber() + 1; int moveMNNumber = - !newBranch || history.getData().firstBranch ? history.getMoveMNNumber() + 1 : 1; + isNewSubBranch ? 1 : isMissingMoveMNNumber ? -1 : history.getMoveMNNumber() + 1; int[] moveNumberList = newBranch && history.getNext(true).isPresent() ? new int[Board.boardWidth * Board.boardHeight] diff --git a/src/main/java/featurecat/lizzie/rules/BoardData.java b/src/main/java/featurecat/lizzie/rules/BoardData.java index f26e065fc..668f5bcac 100644 --- a/src/main/java/featurecat/lizzie/rules/BoardData.java +++ b/src/main/java/featurecat/lizzie/rules/BoardData.java @@ -24,7 +24,6 @@ public class BoardData { public boolean verify; public double winrate; - public boolean firstBranch; private int playouts; public int engineIndex; public double komi; diff --git a/src/main/java/featurecat/lizzie/rules/SGFParser.java b/src/main/java/featurecat/lizzie/rules/SGFParser.java index 46a42acb0..aea2e7c63 100644 --- a/src/main/java/featurecat/lizzie/rules/SGFParser.java +++ b/src/main/java/featurecat/lizzie/rules/SGFParser.java @@ -168,7 +168,6 @@ private static BoardHistoryList parseValue( String blackPlayer = "", whitePlayer = ""; String blackPlayerRank = "", whitePlayerRank = ""; - int previousDepth = -1; // Support unicode characters (UTF-8) for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); @@ -184,8 +183,6 @@ private static BoardHistoryList parseValue( if (!inTag) { subTreeDepth += 1; // Initialize the step count - Lizzie.board.getData().firstBranch = previousDepth < subTreeDepth; - previousDepth = subTreeDepth; subTreeStepMap.put(subTreeDepth, 0); addPassForMove = true; pendingProps = new HashMap();