Correctly prevent xd locked shinies

oops, 7fd7a86074 was not correct (only handled lockless) -- the verifier doesn't check the final shadow pokemon (not a lock).

https://projectpokemon.org/home/forums/topic/57014-shiny-shadow-pok%C3%A9mon-from-xd-shown-as-legal-pkhex-legality-check-error/
This commit is contained in:
Kurt 2020-05-08 10:07:21 -07:00
parent 383cf3e514
commit 5fc15dc9c8

View file

@ -6,9 +6,11 @@ namespace PKHeX.Core
{ {
public static bool IsAllShadowLockValid(EncounterStaticShadow s, PIDIV pv, PKM pkm) public static bool IsAllShadowLockValid(EncounterStaticShadow s, PIDIV pv, PKM pkm)
{ {
if (s.Version == GameVersion.XD && pkm.IsShiny)
return false; // no xd shiny shadow mons
var teams = s.Locks; var teams = s.Locks;
if (teams.Length == 0) if (teams.Length == 0)
return s.Version == GameVersion.COLO || !pkm.IsShiny; // no xd shiny shadow mons return true;
var tsv = s.Version == GameVersion.XD ? (pkm.TID ^ pkm.SID) >> 3 : -1; // no xd shiny shadow mons var tsv = s.Version == GameVersion.XD ? (pkm.TID ^ pkm.SID) >> 3 : -1; // no xd shiny shadow mons
return IsAllShadowLockValid(pv, teams, tsv); return IsAllShadowLockValid(pv, teams, tsv);