mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-27 06:15:20 -05:00
Discard Fairy type Arceus when reversing
https://projectpokemon.org/home/forums/topic/63635-pkhex-230709-bugs/
This commit is contained in:
@@ -18,7 +18,8 @@ public int Devolve(Span<EvoCriteria> result, PKM pk, EvolutionOrigin enc)
|
||||
int present = 1;
|
||||
for (int i = 1; i < result.Length; i++)
|
||||
{
|
||||
var prev = result[i - 1];
|
||||
ref var prev = ref result[i - 1];
|
||||
RevertMutatedForms(ref prev);
|
||||
if (!TryDevolve(prev, pk, prev.LevelMax, enc.LevelMin, enc.SkipChecks, out var evo))
|
||||
continue;
|
||||
|
||||
@@ -30,6 +31,12 @@ public int Devolve(Span<EvoCriteria> result, PKM pk, EvolutionOrigin enc)
|
||||
return present;
|
||||
}
|
||||
|
||||
private static void RevertMutatedForms(ref EvoCriteria evo)
|
||||
{
|
||||
if (evo is { Species: (ushort)Species.Arceus, Form: 17 }) // Fairy, prevent it hitting Gen5 (as Fairy does not exist yet).
|
||||
evo = evo with { Form = 0 }; // Normal
|
||||
}
|
||||
|
||||
public bool TryDevolve(ISpeciesForm head, PKM pk, byte currentMaxLevel, byte levelMin, bool skipChecks, out EvoCriteria result)
|
||||
{
|
||||
return Tree.Reverse.TryDevolve(head, pk, currentMaxLevel, levelMin, skipChecks, out result);
|
||||
|
||||
@@ -413,7 +413,7 @@ private static void VerifyTrade8b(LegalityAnalysis data, EncounterTrade8b t)
|
||||
data.AddLine(GetInvalid(string.Format(LOTLanguage, $"{Japanese}/{German}", $"{(LanguageID)pk.Language}"), CheckIdentifier.Language));
|
||||
}
|
||||
|
||||
if (t.Species == (int)Species.Chatot && pk.Language == (int)French)
|
||||
if (t.Species == (int)Species.Chatot && pk is { Language: (int)French, IsNicknamed: false })
|
||||
{
|
||||
// NgWord disallows the French nickname (Pijouk) and resets it back to default (Pijako).
|
||||
// Let it be anything (Nicknamed or not) and just verify the OT.
|
||||
|
||||
Reference in New Issue
Block a user