Skip to content

Commit f9a249a

Browse files
authored
Merge pull request #483 from MovingBlocks/menuBgAndroidFix
Fix android menuBG
2 parents 3378a2b + fac0ad5 commit f9a249a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

engine/src/main/java/org/destinationsol/menu/background/MenuBackgroundShipManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ public MenuBackgroundShipManager(DisplayDimensions displayDimensions, World worl
6363
for (ResourceUrn configUrn : configUrnList) {
6464
JSONObject rootNode = Assets.getJson(configUrn.toString()).getJsonValue();
6565
JSONArray ships = rootNode.getJSONArray("Menu Ships");
66-
ships.forEach(shipUrn -> {
66+
// JSONArray.iterator must not be used (foreach uses it internally), as Android does not support it
67+
// (you cannot override the dependency either, as it is a system library).
68+
for (int index = 0; index < ships.length(); index++) {
69+
Object shipUrn = ships.get(index);
6770
if (!availableShips.contains(shipUrn.toString())) {
6871
availableShips.add(shipUrn.toString());
6972
}
70-
});
73+
}
7174
}
7275
}
7376

0 commit comments

Comments
 (0)