revise xd ID check to exclude PAL

ty John_0902 on discord
This commit is contained in:
Kurt
2025-05-29 10:16:51 -05:00
parent fd766a5506
commit 87d55fc303
2 changed files with 13 additions and 2 deletions

View File

@@ -631,7 +631,7 @@ public static bool IsValidNameScreenEndSeed(uint seed, out uint origin)
// rand() / 10 == 0 is a skip
const ushort SEED_THRESHOLD = 0x1999; // Only need the upper 16 bits
var p1 = XDRNG.Prev16(ref seed) > SEED_THRESHOLD;
var p1 = (seed >> 16) > SEED_THRESHOLD;
var p2 = XDRNG.Prev16(ref seed) > SEED_THRESHOLD;
var p3 = XDRNG.Prev16(ref seed) > SEED_THRESHOLD;
var p4 = XDRNG.Prev16(ref seed) > SEED_THRESHOLD;

View File

@@ -85,8 +85,19 @@ public static bool TryGetShinySID(uint pid, ushort tid, GameVersion version, out
private static void VerifyTrainerID_CXD<T>(LegalityAnalysis data, T tr) where T : ITrainerID32ReadOnly
{
var severity = Severity.Invalid;
if (data.EncounterOriginal is (EncounterSlot3XD or EncounterShadow3XD or EncounterStatic3XD))
{
// XD does not do the rand1000 on PAL copies of the game.
var lang = (LanguageID)data.Entity.Language;
if (lang > LanguageID.English) // definitely PAL
return;
if (lang is LanguageID.English)
severity = Severity.Fishy; // can be PAL or US, let user verify.
// japanese will stay Invalid
}
if (!MethodCXD.TryGetSeedTrainerID(tr.TID16, tr.SID16, out _))
data.AddLine(GetInvalid(LTrainerIDNoSeed, CheckIdentifier.Trainer));
data.AddLine(Get(LTrainerIDNoSeed, severity, CheckIdentifier.Trainer));
}
private static void VerifyTrainerID_RS<T>(LegalityAnalysis data, T tr, Severity severity = Severity.Invalid) where T : ITrainerID32ReadOnly