From a0bdb1a40e21ce87ef19df0682929a1801b28e95 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 12 Aug 2021 17:33:31 -0700 Subject: [PATCH] Fix OT->HT memory string output for HT verifier Use the `memory.Handler string` value rather than recomputing. (lines 51, 64 pf memverify) --- PKHeX.Core/Legality/Restrictions/Memories.cs | 2 +- PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PKHeX.Core/Legality/Restrictions/Memories.cs b/PKHeX.Core/Legality/Restrictions/Memories.cs index bd65c0945..76c3536f5 100644 --- a/PKHeX.Core/Legality/Restrictions/Memories.cs +++ b/PKHeX.Core/Legality/Restrictions/Memories.cs @@ -263,7 +263,7 @@ private MemoryVariableSet(string handler, int m, int v, int i, int f) public static MemoryVariableSet Read(ITrainerMemories pkm, int handler) => handler switch { 0 => new MemoryVariableSet(LegalityCheckStrings.L_XOT, pkm.OT_Memory, pkm.OT_TextVar, pkm.OT_Intensity, pkm.OT_Feeling), // OT - 1 => new MemoryVariableSet(LegalityCheckStrings.L_XOT, pkm.HT_Memory, pkm.HT_TextVar, pkm.HT_Intensity, pkm.HT_Feeling), // HT + 1 => new MemoryVariableSet(LegalityCheckStrings.L_XHT, pkm.HT_Memory, pkm.HT_TextVar, pkm.HT_Intensity, pkm.HT_Feeling), // HT _ => new MemoryVariableSet(LegalityCheckStrings.L_XOT, 0, 0, 0, 0) }; diff --git a/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs b/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs index b745c78e4..c3917fc5f 100644 --- a/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs @@ -48,7 +48,7 @@ private CheckResult VerifyCommonMemory(PKM pkm, int handler, int gen, LegalInfo case 71 when !GetCanDynamaxTrainer(memory.Variable, 8, handler == 0 ? (GameVersion)pkm.Version : GameVersion.Any): // {0} battled {2} and Dynamaxed upon {1}’s instruction. {4} that {3}. case 72 when !((PersonalInfoSWSH)PersonalTable.SWSH[memory.Variable]).IsPresentInGame: - return GetInvalid(string.Format(LMemoryArgBadSpecies, handler == 0 ? L_XOT : L_XHT)); + return GetInvalid(string.Format(LMemoryArgBadSpecies, memory.Handler)); // Move // {0} studied about how to use {2} in a Box, thinking about {1}. {4} that {3}. @@ -61,7 +61,7 @@ private CheckResult VerifyCommonMemory(PKM pkm, int handler, int gen, LegalInfo // {0} became good friends with the {2} in a Box, practiced moves with it, and talked about the day that {0} would be praised by {1}. {4} that {3}. // {0} got in a fight with the {2} that it was in a Box with about {1}. {4} that {3}. case 82 or 83 or 87 when !((PersonalInfoSWSH)PersonalTable.SWSH[memory.Variable]).IsPresentInGame: - return GetInvalid(string.Format(LMemoryArgBadSpecies, handler == 0 ? L_XOT : L_XHT)); + return GetInvalid(string.Format(LMemoryArgBadSpecies, memory.Handler)); // Item // {0} went to a Pokémon Center with {1} to buy {2}. {4} that {3}. @@ -297,10 +297,10 @@ private void VerifyHTMemory(LegalityAnalysis data) // {0} went to the Pokémon Center in {2} with {1} and had its tired body healed there. {4} that {3}. case 6 when memoryGen == 6 && !Memories.GetHasPokeCenterLocation(GameVersion.Gen6, mem.HT_TextVar): - data.AddLine(GetInvalid(string.Format(LMemoryArgBadLocation, L_XOT))); + data.AddLine(GetInvalid(string.Format(LMemoryArgBadLocation, L_XHT))); return; case 6 when memoryGen == 8 && mem.HT_TextVar != 0: - data.AddLine(Get(string.Format(LMemoryArgBadLocation, L_XOT), ParseSettings.Gen8MemoryLocationTextVariable)); + data.AddLine(Get(string.Format(LMemoryArgBadLocation, L_XHT), ParseSettings.Gen8MemoryLocationTextVariable)); return; // {0} was with {1} when {1} caught {2}. {4} that {3}.