From 88f5b7bc0fc6ac127cbc662448bdd592827ea02a Mon Sep 17 00:00:00 2001 From: tom-overton Date: Mon, 5 Sep 2022 04:13:25 -0700 Subject: Fix an issue where certain cosmetic forms cannot be randomly chosen in Gen 7 (fixes #530) --- src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java index c8a8457..737eedc 100644 --- a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java @@ -502,6 +502,16 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { } } } + + // The above code will add all alternate cosmetic forms to realCosmeticFormNumbers as necessary, but it will + // NOT add the base form. For example, if we are currently looking at Mimikyu, it will add Totem Mimikyu to + // the list of realCosmeticFormNumbers, but it will not add normal-sized Mimikyu. Without any corrections, + // this will make base Mimikyu impossible to randomly select. The simplest way to fix this is to just add + // the base form to the realCosmeticFormNumbers here if that list was populated above. + if (pkmn.realCosmeticFormNumbers.size() > 0) { + pkmn.realCosmeticFormNumbers.add(0); + pkmn.cosmeticForms += 1; + } } private String[] readPokemonNames() { -- cgit v1.2.3