kwsch / PKHeX

Pokémon Save File Editor
https://projectpokemon.org/pkhex/
Other
3.71k stars 698 forks source link

PKHeX don't set current handler to 1 for past gen pokemon from Encounter Database #3364

Closed javierhimura closed 2 years ago

javierhimura commented 2 years ago

Describe the problem A clear and concise description of what the bug is. This is not to ask why fabricated data does not pass the legality check. I have been playing lately with the Encounter Database looking at various pokemon available and I have noticed that after selecting any pre gen 7 pokemon and clicking View it always gives a pokemon with the legal error "Current handler cannot be past gen OT for transferred specimen." because the program those not set CurrentHandler flag to 1 for this pokemon.

This does not happen for actual pkm files from past generations, in those ones the flag is changed upon opening the pk file. Mistery Gif database also works correctly.

To Reproduce Open PkHex with a blank save files from Sword and select from Encounter Database a pokemon from gens 1 to 6

Expected behavior A pokemon from Encounter Database should be open by default with a legal current handler flag.

kwsch commented 2 years ago

This is because the encounter->PKM logic uses the current save file to populate trainer data. Handler detection (matches the games) only checks for OT/Gender/ID equivalence, thus past gen stuff results in being handled by the OT (statistically not possible unless abused).

I'll add something so PKHeX looks for suitable trainers that is up to the user to populate.