Fix shiny/nonshiny egg mysterygift link trade checks

thanks @Admiral-Fish for finding this case
This commit is contained in:
Kurt
2018-01-28 23:40:57 -08:00
parent 9085dfd950
commit 74f185591a
2 changed files with 22 additions and 7 deletions

View File

@@ -2314,7 +2314,7 @@ private void VerifyFatefulMysteryGift(MysteryGift g)
if (g is PGF p && p.IsShiny)
{
Info.PIDIV = MethodFinder.Analyze(pkm);
if (Info.PIDIV.Type != PIDType.G5MGShiny)
if (Info.PIDIV.Type != PIDType.G5MGShiny && pkm.Egg_Location != 30003)
AddLine(Severity.Invalid, V411, CheckIdentifier.PID);
}

View File

@@ -1316,8 +1316,13 @@ private static bool GetIsMatchPGF(PKM pkm, PGF wc, IEnumerable<DexLevel> vs)
}
else
{
if (wc.EggLocation != pkm.Egg_Location && pkm.Egg_Location != 30003) // traded
return false;
if (wc.EggLocation != pkm.Egg_Location) // traded
{
if (pkm.Egg_Location != 30003)
return false;
}
else if (wc.PIDType == 0 && pkm.IsShiny)
return false; // can't be traded away for unshiny
if (pkm.IsEgg && !pkm.IsNative)
return false;
}
@@ -1357,8 +1362,13 @@ private static bool GetIsMatchWC6(PKM pkm, WC6 wc, IEnumerable<DexLevel> vs)
if (wc.IsEgg)
{
if (wc.EggLocation != pkm.Egg_Location && pkm.Egg_Location != 30002) // traded
return false;
if (wc.EggLocation != pkm.Egg_Location) // traded
{
if (pkm.Egg_Location != 30002)
return false;
}
else if (wc.PIDType == 0 && pkm.IsShiny)
return false; // can't be traded away for unshiny
if (pkm.IsEgg && !pkm.IsNative)
return false;
}
@@ -1410,8 +1420,13 @@ private static bool GetIsMatchWC7(PKM pkm, WC7 wc, IEnumerable<DexLevel> vs)
if (wc.IsEgg)
{
if (wc.EggLocation != pkm.Egg_Location && pkm.Egg_Location != 30002) // traded
return false;
if (wc.EggLocation != pkm.Egg_Location) // traded
{
if (pkm.Egg_Location != 30002)
return false;
}
else if (wc.PIDType == 0 && pkm.IsShiny)
return false; // can't be traded away for unshiny
if (pkm.IsEgg && !pkm.IsNative)
return false;
}