From c340cfcc1991228fe37ff0cf4768ccb8e416d548 Mon Sep 17 00:00:00 2001 From: tom-overton Date: Wed, 28 Dec 2022 03:07:52 -0800 Subject: Fix crash when wild encounters are randomized in HGSS --- src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java | 2 +- src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java | 2 +- src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java index 51aeae9..267a42c 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java @@ -1563,7 +1563,7 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { @Override public List bannedForWildEncounters() { // Ban Unown because they don't show up unless you complete a puzzle in the Ruins of Alph. - return Collections.singletonList(pokes[Species.unown]); + return new ArrayList<>(Collections.singletonList(pokes[Species.unown])); } @Override diff --git a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java index 35961c8..cefb3c4 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java @@ -1791,7 +1791,7 @@ public class Gen3RomHandler extends AbstractGBRomHandler { if (romEntry.romType == Gen3Constants.RomType_FRLG) { // Ban Unown in FRLG because the game crashes if it is encountered outside of Tanoby Ruins. // See GenerateWildMon in wild_encounter.c in pokefirered - return Collections.singletonList(pokes[Species.unown]); + return new ArrayList<>(Collections.singletonList(pokes[Species.unown])); } return new ArrayList<>(); } diff --git a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java index d3904f8..00d525d 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java @@ -3105,7 +3105,7 @@ public class Gen4RomHandler extends AbstractDSRomHandler { public List bannedForWildEncounters() { if (romEntry.romType == Gen4Constants.Type_HGSS) { // Ban Unown in HGSS because they don't show up unless you complete a puzzle in the Ruins of Alph. - return Collections.singletonList(pokes[Species.unown]); + return new ArrayList<>(Collections.singletonList(pokes[Species.unown])); } return new ArrayList<>(); } -- cgit v1.2.3