Misc fixes & pickle updates

This commit is contained in:
Kurt 2022-08-30 21:15:07 -07:00
parent 66e0613d82
commit d350bb7fee
9 changed files with 12 additions and 12 deletions

View file

@ -100,7 +100,7 @@ public static partial class Legal
/// <param name="pk">Entity to check</param>
internal static bool IsOriginalMovesetDeleted(this PKM pk)
{
if (pk.IsNative)
if (pk.Format == 8 && pk.Generation == 8)
return IsSideGameTransferDeletedMoveset(pk);
return pk is IBattleVersion { BattleVersion: not 0 };
}

View file

@ -238,12 +238,12 @@ public sealed class WA8 : DataMysteryGift, ILangNick, INature, IGigantamax, IDyn
public ushort OT_TextVar { get => ReadUInt16LittleEndian(Data.AsSpan(0x274)); set => WriteUInt16LittleEndian(Data.AsSpan(0x274), value); }
// Only derivations to WC8
public byte GV_HP { get => Data[0x27E]; set => Data[0x27E] = value; }
public byte GV_ATK { get => Data[0x27F]; set => Data[0x27F] = value; }
public byte GV_DEF { get => Data[0x280]; set => Data[0x280] = value; }
public byte GV_SPE { get => Data[0x281]; set => Data[0x281] = value; }
public byte GV_SPA { get => Data[0x282]; set => Data[0x282] = value; }
public byte GV_SPD { get => Data[0x283]; set => Data[0x283] = value; }
public byte GV_HP { get => Data[0x276]; set => Data[0x276] = value; }
public byte GV_ATK { get => Data[0x277]; set => Data[0x277] = value; }
public byte GV_DEF { get => Data[0x278]; set => Data[0x278] = value; }
public byte GV_SPE { get => Data[0x279]; set => Data[0x279] = value; }
public byte GV_SPA { get => Data[0x27A]; set => Data[0x27A] = value; }
public byte GV_SPD { get => Data[0x27B]; set => Data[0x27B] = value; }
// Meta Accessible Properties
public override int[] IVs

View file

@ -691,7 +691,7 @@ public sealed class WC8 : DataMysteryGift, ILangNick, INature, IGigantamax, IDyn
if (pk is PK8 and IGigantamax g && g.CanGigantamax != CanGigantamax && !g.CanToggleGigantamax(pk.Species, pk.Form, Species, Form))
return false;
if (pk is not IDynamaxLevel dl || dl.DynamaxLevel < DynamaxLevel)
if (pk is PK8 pk8 && pk8.DynamaxLevel < DynamaxLevel)
return false;
if (IsHOMEGift && pk is IScaledSize s)

View file

@ -240,7 +240,7 @@ public partial class SAV_Database : Form
CB_GameOrigin.InitializeBinding();
CB_HPType.InitializeBinding();
var comboAny = new ComboItem(MsgAny, 0);
var comboAny = new ComboItem(MsgAny, -1);
var species = new List<ComboItem>(GameInfo.SpeciesDataSource);
species.RemoveAt(0);

View file

@ -174,7 +174,7 @@ public partial class SAV_MysteryGiftDB : Form
CB_HeldItem.InitializeBinding();
CB_Species.InitializeBinding();
var comboAny = new ComboItem(MsgAny, 0);
var comboAny = new ComboItem(MsgAny, -1);
var species = new List<ComboItem>(GameInfo.SpeciesDataSource);
species.RemoveAt(0);
@ -300,9 +300,9 @@ public partial class SAV_MysteryGiftDB : Form
}
// Primary Searchables
var species = (ushort)WinFormsUtil.GetIndex(CB_Species);
var species = WinFormsUtil.GetIndex(CB_Species);
int item = WinFormsUtil.GetIndex(CB_HeldItem);
if (species != 0) res = res.Where(pk => pk.Species == species);
if (species != -1) res = res.Where(pk => pk.Species == species);
if (item != -1) res = res.Where(pk => pk.HeldItem == item);
// Secondary Searchables