mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 04:16:54 -05:00
MysteryGift drop: use extension-less method if w/o
New Korean WC9 is restrict:0 so just make it behave like restrict:3 -- verifies all possible versions that way.
This commit is contained in:
@@ -34,10 +34,9 @@ public enum GiftType : byte
|
||||
|
||||
public bool CanBeReceivedByVersion(PKM pk) => RestrictVersion switch
|
||||
{
|
||||
0 when !IsEntity => true, // Whatever, essentially unrestricted for SL/VL receipt. No Entity gifts are 0.
|
||||
1 => pk.Version is GameVersion.SL || pk.MetLocation == LocationsHOME.SWSL,
|
||||
2 => pk.Version is GameVersion.VL || pk.MetLocation == LocationsHOME.SHVL,
|
||||
3 => pk.Version is GameVersion.SL or GameVersion.VL || pk.MetLocation is LocationsHOME.SWSL or LocationsHOME.SHVL,
|
||||
0 or 3 => pk.Version is GameVersion.SL or GameVersion.VL || pk.MetLocation is LocationsHOME.SWSL or LocationsHOME.SHVL,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(RestrictVersion), RestrictVersion, null),
|
||||
};
|
||||
|
||||
|
||||
@@ -289,7 +289,9 @@ public static bool TryGetBattleVideo(byte[] data, [NotNullWhen(true)] out IBattl
|
||||
/// <returns>True if file object reference is valid, false if none found.</returns>
|
||||
public static bool TryGetMysteryGift(byte[] data, [NotNullWhen(true)] out MysteryGift? mg, ReadOnlySpan<char> ext)
|
||||
{
|
||||
mg = MysteryGift.GetMysteryGift(data, ext);
|
||||
mg = ext.Length == 0
|
||||
? MysteryGift.GetMysteryGift(data)
|
||||
: MysteryGift.GetMysteryGift(data, ext);
|
||||
return mg != null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user