Reference original encounter for sensitive checks

https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?do=findComment&comment=234360
thanks paf!
This commit is contained in:
Kurt 2018-08-01 20:39:20 -07:00
parent f4bfdb8311
commit 19a897923d
4 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ namespace PKHeX.Core
public override void Verify(LegalityAnalysis data)
{
var pkm = data.pkm;
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
if (EncounterMatch is MysteryGift gift)
{
if (gift.Level != pkm.Met_Level && pkm.HasOriginalMetLocation)
@ -64,7 +64,7 @@ namespace PKHeX.Core
public void VerifyG1(LegalityAnalysis data)
{
var pkm = data.pkm;
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
if (pkm.IsEgg)
{
int elvl = Legal.GetEggHatchLevel(pkm);

View file

@ -181,7 +181,7 @@ namespace PKHeX.Core
if (pkm.Move1_PP != pkm.GetMovePP(pkm.Move1, 0) || pkm.Move2_PP != pkm.GetMovePP(pkm.Move2, 0) || pkm.Move3_PP != pkm.GetMovePP(pkm.Move3, 0) || pkm.Move4_PP != pkm.GetMovePP(pkm.Move4, 0))
data.AddLine(GetInvalid(V420, CheckIdentifier.Egg));
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
var HatchCycles = (EncounterMatch as EncounterStatic)?.EggCycles;
if (HatchCycles == 0 || HatchCycles == null)
HatchCycles = pkm.PersonalInfo.HatchCycles;

View file

@ -13,7 +13,7 @@ namespace PKHeX.Core
public override void Verify(LegalityAnalysis data)
{
var pkm = data.pkm;
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
// If the Pokémon is not nicknamed, it should match one of the language strings.
if (pkm.Nickname.Length == 0)
@ -84,7 +84,7 @@ namespace PKHeX.Core
}
else
{
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
// Can't have another language name if it hasn't evolved or wasn't a language-traded egg.
bool evolved = EncounterMatch.Species != pkm.Species;
bool match = PKX.GetSpeciesNameGeneration(pkm.Species, pkm.Language, pkm.Format) == nickname;
@ -394,7 +394,7 @@ namespace PKHeX.Core
string OT = validOT[(validOT.Length / 2) + index];
var pkm = data.pkm;
var EncounterMatch = data.EncounterMatch;
var EncounterMatch = data.EncounterOriginal;
if (!IsNicknameMatch(nick, pkm, EncounterMatch)) // trades that are not nicknamed (but are present in a table with others being named)
data.AddLine(GetInvalid(V9, CheckIdentifier.Nickname));
else