mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 17:15:28 -05:00
Allow TSV=0 for home accounts
This commit is contained in:
@@ -38,8 +38,6 @@ private static IEnumerable<IEncounterable> GetPossibleSlots(EvoCriteria[] chain,
|
||||
|
||||
public IEnumerable<IEncounterable> GetEncounters(PKM pk, EvoCriteria[] chain, LegalInfo info)
|
||||
{
|
||||
if (pk.TSV == 0) // HOME doesn't assign TSV=0 to accounts.
|
||||
yield break;
|
||||
if (!CanBeWildEncounter(pk))
|
||||
yield break;
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ private uint GetFixedPID(ITrainerID32 tr)
|
||||
return pid;
|
||||
}
|
||||
|
||||
private static uint GetAntishinyFixedHOME(ITrainerID32 tr) => tr.ID32 ^ 0x10u;
|
||||
private static uint GetAntishinyFixedHOME(ITrainerID32 tr) => tr.ID32 + 0x10u;
|
||||
|
||||
private static uint GetAntishiny(ITrainerID32 tr)
|
||||
{
|
||||
|
||||
@@ -477,12 +477,12 @@ public override PK8 ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria)
|
||||
pk.TID16 = tr.TID16;
|
||||
pk.SID16 = tr.SID16;
|
||||
|
||||
// Initial updates of HOME did not assign a TSV of 0.
|
||||
// After enough server updates, HOME can now assign a TSV of 0.
|
||||
// They will XOR the PID to ensure the shiny state of gifts is matched.
|
||||
// Don't set a Secret ID.
|
||||
if (IsHOMEGift)
|
||||
{
|
||||
pk.ID32 %= 1_000_000;
|
||||
while (pk.TSV == 0)
|
||||
pk.ID32 = (uint)Util.Rand.Next(16, 999_999 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Official code explicitly corrects for Meowstic
|
||||
@@ -650,8 +650,11 @@ public override bool IsMatchExact(PKM pk, EvoCriteria evo)
|
||||
if (EncryptionConstant != pk.EncryptionConstant)
|
||||
return false;
|
||||
|
||||
if (pk.TSV == 0) // HOME doesn't assign TSV=0 to accounts.
|
||||
return false;
|
||||
// Initial updates of HOME did not assign a TSV of 0.
|
||||
// After enough server updates, HOME can now assign a TSV of 0.
|
||||
// They will XOR the PID to ensure the shiny state of gifts is matched.
|
||||
// if (pk.TSV == 0) // HOME doesn't assign TSV=0 to accounts.
|
||||
// return false;
|
||||
|
||||
if (IsShiny)
|
||||
{
|
||||
|
||||
@@ -195,9 +195,11 @@ public static bool TryGetMemoryCard(byte[] data, [NotNullWhen(true)] out SAV3GCM
|
||||
/// <inheritdoc cref="TryGetMemoryCard(byte[], out SAV3GCMemoryCard?)"/>
|
||||
public static bool TryGetMemoryCard(string file, [NotNullWhen(true)] out SAV3GCMemoryCard? memcard)
|
||||
{
|
||||
memcard = null;
|
||||
if (!File.Exists(file))
|
||||
{
|
||||
memcard = null;
|
||||
return false;
|
||||
}
|
||||
var data = File.ReadAllBytes(file);
|
||||
return TryGetMemoryCard(data, out memcard);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user