diff options
author | tom-overton <tom.overton@outlook.com> | 2022-09-05 04:13:25 -0700 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-09-06 17:20:36 +0100 |
commit | 88f5b7bc0fc6ac127cbc662448bdd592827ea02a (patch) | |
tree | 6988a128817d2f0ef50e2835fa03a6d256f821bf /src/com/sneed/pkrandom | |
parent | b798550825e998935da91c242acee373e7b6240f (diff) |
Fix an issue where certain cosmetic forms cannot be randomly chosen in Gen 7 (fixes #530)
Diffstat (limited to 'src/com/sneed/pkrandom')
-rw-r--r-- | src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java | 10 |
1 files changed, 10 insertions, 0 deletions
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() { |