Skip to content

Commit

Permalink
Sometimes the "L" prop is part of the game node rather than the first
Browse files Browse the repository at this point in the history
move.
  • Loading branch information
toomasr committed May 27, 2018
1 parent c53cdec commit ed53819
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/toomasr/sgf4j/gui/MainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ private void showMarkersForMove(GameNode move) {
// the L property is actually not used in FF3 and FF4
// but I own many SGFs that still have it
String markerProp = move.getProperty("L");
// the L property is sometimes attached to the game instead part instead
if (markerProp == null && move.getParentNode() == null && game.getProperty("L") != null) {
markerProp = game.getProperty("L");
}
if (markerProp != null) {
int alphaIdx = 0;
String[] markers = markerProp.split("\\]\\[");
Expand All @@ -804,7 +808,10 @@ private void removeMarkersForNode(GameNode node) {
// the L property is actually not used in FF3 and FF4
// but I own many SGFs that still have it
String markerProp = node.getProperty("L");

// the L property is sometimes attached to the game instead part instead
if (markerProp == null && node.getParentNode() == null && game.getProperty("L") != null) {
markerProp = game.getProperty("L");
}
if (markerProp != null) {
String[] markers = markerProp.split("\\]\\[");
for (int i = 0; i < markers.length; i++) {
Expand Down

0 comments on commit ed53819

Please sign in to comment.