mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 04:24:36 -05:00
Fix recog of Home fixed PID shinies
Not to be confused with Home fixed PID antishinies WC8 is the only format to have fixed shinies, but let's copy the logic to WB8 and WA8 if they're ever added in the future. Fix mgdb display filtering for SWSH & PLA (swapped oops) Closes #3511
This commit is contained in:
parent
e571a0b95f
commit
86814d014d
|
|
@ -548,9 +548,13 @@ private void SetPINGA(PKM pk, EncounterCriteria criteria)
|
|||
ShinyType8.FixedValue => GetFixedPID(tr),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type)),
|
||||
};
|
||||
|
||||
private uint GetFixedPID(ITrainerID tr)
|
||||
{
|
||||
var pid = PID;
|
||||
if (pid != 0 && !(TID == 0 && SID == 0))
|
||||
return pid;
|
||||
|
||||
if (!tr.IsShiny(pid, 8))
|
||||
return pid;
|
||||
if (IsHOMEGift)
|
||||
|
|
|
|||
|
|
@ -548,6 +548,9 @@ private void SetPINGA(PKM pk, EncounterCriteria criteria)
|
|||
private uint GetFixedPID(ITrainerID tr)
|
||||
{
|
||||
var pid = PID;
|
||||
if (pid != 0 && !(TID == 0 && SID == 0))
|
||||
return pid;
|
||||
|
||||
if (!tr.IsShiny(pid, 8))
|
||||
return pid;
|
||||
if (IsHOMEGift)
|
||||
|
|
|
|||
|
|
@ -541,6 +541,9 @@ private void SetPINGA(PKM pk, EncounterCriteria criteria)
|
|||
private uint GetFixedPID(ITrainerID tr)
|
||||
{
|
||||
var pid = PID;
|
||||
if (pid != 0 && !(TID == 0 && SID == 0))
|
||||
return pid;
|
||||
|
||||
if (!tr.IsShiny(pid, 8))
|
||||
return pid;
|
||||
if (IsHOMEGift && !IsHOMEShinyPossible(DateTime.Now))
|
||||
|
|
|
|||
|
|
@ -214,11 +214,14 @@ private void LoadDatabase()
|
|||
|
||||
if (Main.Settings.MysteryDb.FilterUnavailableSpecies)
|
||||
{
|
||||
static bool IsPresentInGameSWSH(ISpeciesForm pk) => PersonalTable.SWSH.IsPresentInGame(pk.Species, pk.Form);
|
||||
static bool IsPresentInGameBDSP(ISpeciesForm pk) => PersonalTable.BDSP.IsPresentInGame(pk.Species, pk.Form);
|
||||
static bool IsPresentInGameLA(ISpeciesForm pk) => PersonalTable.LA.IsPresentInGame(pk.Species, pk.Form);
|
||||
db = SAV switch
|
||||
{
|
||||
SAV8LA => db.Where(z => PersonalTable.SWSH.IsPresentInGame(z.Species, z.Form)),
|
||||
SAV8BS => db.Where(z => PersonalTable.BDSP.IsPresentInGame(z.Species, z.Form)),
|
||||
SAV8SWSH => db.Where(z => PersonalTable.LA.IsPresentInGame(z.Species, z.Form)),
|
||||
SAV8SWSH => db.Where(IsPresentInGameSWSH),
|
||||
SAV8BS => db.Where(IsPresentInGameBDSP),
|
||||
SAV8LA => db.Where(IsPresentInGameLA),
|
||||
SAV7b => db.Where(z => z is WB7),
|
||||
SAV7 => db.Where(z => z.Generation < 7 || z is WC7),
|
||||
_ => db.Where(z => z.Generation <= SAV.Generation),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user