diff --git a/PKHeX.Core/Editing/CommonEdits.cs b/PKHeX.Core/Editing/CommonEdits.cs
index a67e4c055..ccb9ce688 100644
--- a/PKHeX.Core/Editing/CommonEdits.cs
+++ b/PKHeX.Core/Editing/CommonEdits.cs
@@ -252,7 +252,7 @@ public static void ApplySetDetails(this PKM pk, IBattleTemplate Set)
if (pk is IGigantamax c)
c.CanGigantamax = Set.CanGigantamax;
if (pk is IDynamaxLevel d)
- d.DynamaxLevel = d.CanHaveDynamaxLevel(pk) ? 10 : 0;
+ d.DynamaxLevel = d.CanHaveDynamaxLevel(pk) ? (byte)10 : (byte)0;
pk.ClearRecordFlags();
pk.SetRecordFlags(Set.Moves);
diff --git a/PKHeX.Core/MysteryGifts/PGF.cs b/PKHeX.Core/MysteryGifts/PGF.cs
index a6474a18e..3646fc15b 100644
--- a/PKHeX.Core/MysteryGifts/PGF.cs
+++ b/PKHeX.Core/MysteryGifts/PGF.cs
@@ -83,7 +83,7 @@ public override string OT_Name
public int OTGender { get => Data[0x5A]; set => Data[0x5A] = (byte)value; }
public override int Level { get => Data[0x5B]; set => Data[0x5C] = (byte)value; }
- public override bool IsEgg { get => Data[0x5C] == 1; set => Data[0x5C] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[0x5C] == 1; set => Data[0x5C] = value ? (byte)1 : (byte)0; }
// Unused 0x5D 0x5E 0x5F
public override string CardTitle
{
@@ -140,7 +140,7 @@ public override int CardID
public int CardLocation { get => Data[0xB2]; set => Data[0xB2] = (byte)value; }
public int CardType { get => Data[0xB3]; set => Data[0xB3] = (byte)value; }
public override bool GiftUsed { get => Data[0xB4] >> 1 > 0; set => Data[0xB4] = (byte)((Data[0xB4] & ~2) | (value ? 2 : 0)); }
- public bool MultiObtain { get => Data[0xB4] == 1; set => Data[0xB4] = value ? 1 : 0; }
+ public bool MultiObtain { get => Data[0xB4] == 1; set => Data[0xB4] = value ? (byte)1 : (byte)0; }
// Meta Accessible Properties
public override int[] IVs
diff --git a/PKHeX.Core/MysteryGifts/PL6.cs b/PKHeX.Core/MysteryGifts/PL6.cs
index 9e5a44685..4d43b8496 100644
--- a/PKHeX.Core/MysteryGifts/PL6.cs
+++ b/PKHeX.Core/MysteryGifts/PL6.cs
@@ -27,7 +27,7 @@ public sealed class PL6
get => Data[0x00]; set => Data[0x00] = value;
}
- public bool PL_enabled { get => PL_Flag != 0; set => PL_Flag = value ? 1 << 7 : 0; }
+ public bool PL_enabled { get => PL_Flag != 0; set => PL_Flag = value ? (byte)(1 << 7) : (byte)0; }
///
/// Name of data source
@@ -135,7 +135,7 @@ public string OT
}
public int Level { get => Data[0x68]; set => Data[0x68] = (byte)value; }
- public bool IsEgg { get => Data[0x69] == 1; set => Data[0x69] = value ? 1 : 0; }
+ public bool IsEgg { get => Data[0x69] == 1; set => Data[0x69] = value ? (byte)1 : (byte)0; }
public uint PID { get => BitConverter.ToUInt32(Data, 0x6C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x6C); }
public int RelearnMove1 { get => BitConverter.ToUInt16(Data, 0x70); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x70); }
public int RelearnMove2 { get => BitConverter.ToUInt16(Data, 0x72); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x72); }
diff --git a/PKHeX.Core/MysteryGifts/WB7.cs b/PKHeX.Core/MysteryGifts/WB7.cs
index e3f8afc3b..ad2b3e6ee 100644
--- a/PKHeX.Core/MysteryGifts/WB7.cs
+++ b/PKHeX.Core/MysteryGifts/WB7.cs
@@ -113,7 +113,7 @@ private uint Day
public override bool GiftUsed { get => (CardFlags & 2) == 2; set => CardFlags = (byte)((CardFlags & ~2) | (value ? 2 : 0)); }
public bool GiftOncePerDay { get => (CardFlags & 4) == 4; set => CardFlags = (byte)((CardFlags & ~4) | (value ? 4 : 0)); }
- public bool MultiObtain { get => Data[CardStart + 0x53] == 1; set => Data[CardStart + 0x53] = value ? 1 : 0; }
+ public bool MultiObtain { get => Data[CardStart + 0x53] == 1; set => Data[CardStart + 0x53] = value ? (byte)1 : (byte)0; }
// Item Properties
public override bool IsItem { get => CardType == 1; set { if (value) CardType = 1; } }
@@ -205,7 +205,7 @@ public override int Ball
// }
public override int Level { get => Data[CardStart + 0xD0]; set => Data[CardStart + 0xD0] = (byte)value; }
- public override bool IsEgg { get => Data[CardStart + 0xD1] == 1; set => Data[CardStart + 0xD1] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[CardStart + 0xD1] == 1; set => Data[CardStart + 0xD1] = value ? (byte)1 : (byte)0; }
public ushort AdditionalItem { get => BitConverter.ToUInt16(Data, CardStart + 0xD2); set => BitConverter.GetBytes(value).CopyTo(Data, CardStart + 0xD2); }
public uint PID { get => BitConverter.ToUInt32(Data, 0xD4); set => BitConverter.GetBytes(value).CopyTo(Data, 0xD4); }
diff --git a/PKHeX.Core/MysteryGifts/WC6.cs b/PKHeX.Core/MysteryGifts/WC6.cs
index ef2cfb5d7..325985526 100644
--- a/PKHeX.Core/MysteryGifts/WC6.cs
+++ b/PKHeX.Core/MysteryGifts/WC6.cs
@@ -107,7 +107,7 @@ private uint Day
public int CardType { get => Data[0x51]; set => Data[0x51] = (byte)value; }
public override bool GiftUsed { get => Data[0x52] >> 1 > 0; set => Data[0x52] = (byte)((Data[0x52] & ~2) | (value ? 2 : 0)); }
- public bool MultiObtain { get => Data[0x53] == 1; set => Data[0x53] = value ? 1 : 0; }
+ public bool MultiObtain { get => Data[0x53] == 1; set => Data[0x53] = value ? (byte)1 : (byte)0; }
// Item Properties
public override bool IsItem { get => CardType == 1; set { if (value) CardType = 1; } }
@@ -175,7 +175,7 @@ public override string OT_Name
}
public override int Level { get => Data[0xD0]; set => Data[0xD0] = (byte)value; }
- public override bool IsEgg { get => Data[0xD1] == 1; set => Data[0xD1] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[0xD1] == 1; set => Data[0xD1] = value ? (byte)1 : (byte)0; }
public uint PID { get => BitConverter.ToUInt32(Data, 0xD4); set => BitConverter.GetBytes(value).CopyTo(Data, 0xD4); }
public int RelearnMove1 { get => BitConverter.ToUInt16(Data, 0xD8); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xD8); }
diff --git a/PKHeX.Core/MysteryGifts/WC7.cs b/PKHeX.Core/MysteryGifts/WC7.cs
index 93771348c..c1f540e80 100644
--- a/PKHeX.Core/MysteryGifts/WC7.cs
+++ b/PKHeX.Core/MysteryGifts/WC7.cs
@@ -111,7 +111,7 @@ private uint Day
public override bool GiftUsed { get => (CardFlags & 2) == 2; set => CardFlags = (byte)((CardFlags & ~2) | (value ? 2 : 0)); }
public bool GiftOncePerDay { get => (CardFlags & 4) == 4; set => CardFlags = (byte)((CardFlags & ~4) | (value ? 4 : 0)); }
- public bool MultiObtain { get => Data[0x53] == 1; set => Data[0x53] = value ? 1 : 0; }
+ public bool MultiObtain { get => Data[0x53] == 1; set => Data[0x53] = value ? (byte)1 : (byte)0; }
// BP Properties
public bool IsBP { get => CardType == 3; set { if (value) CardType = 3; } }
@@ -217,7 +217,7 @@ public override string OT_Name
}
public override int Level { get => Data[0xD0]; set => Data[0xD0] = (byte)value; }
- public override bool IsEgg { get => Data[0xD1] == 1; set => Data[0xD1] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[0xD1] == 1; set => Data[0xD1] = value ? (byte)1 : (byte)0; }
public ushort AdditionalItem { get => BitConverter.ToUInt16(Data, 0xD2); set => BitConverter.GetBytes(value).CopyTo(Data, 0xD2); }
public uint PID { get => BitConverter.ToUInt32(Data, 0xD4); set => BitConverter.GetBytes(value).CopyTo(Data, 0xD4); }
diff --git a/PKHeX.Core/MysteryGifts/WC8.cs b/PKHeX.Core/MysteryGifts/WC8.cs
index f769a680e..fe3046180 100644
--- a/PKHeX.Core/MysteryGifts/WC8.cs
+++ b/PKHeX.Core/MysteryGifts/WC8.cs
@@ -163,7 +163,7 @@ public override int HeldItem
public override int Form { get => Data[CardStart + 0x242]; set => Data[CardStart + 0x242] = (byte)value; }
public override int Gender { get => Data[CardStart + 0x243]; set => Data[CardStart + 0x243] = (byte)value; }
public override int Level { get => Data[CardStart + 0x244]; set => Data[CardStart + 0x244] = (byte)value; }
- public override bool IsEgg { get => Data[CardStart + 0x245] == 1; set => Data[CardStart + 0x245] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[CardStart + 0x245] == 1; set => Data[CardStart + 0x245] = value ? (byte)1 : (byte)0; }
public int Nature { get => (sbyte)Data[CardStart + 0x246]; set => Data[CardStart + 0x246] = (byte)value; }
public override int AbilityType { get => Data[CardStart + 0x247]; set => Data[CardStart + 0x247] = (byte)value; }
@@ -179,7 +179,7 @@ public override int HeldItem
public int MetLevel { get => Data[CardStart + 0x249]; set => Data[CardStart + 0x249] = (byte)value; }
public byte DynamaxLevel { get => Data[CardStart + 0x24A]; set => Data[CardStart + 0x24A] = value; }
- public bool CanGigantamax { get => Data[CardStart + 0x24B] != 0; set => Data[CardStart + 0x24B] = value ? 1 : 0; }
+ public bool CanGigantamax { get => Data[CardStart + 0x24B] != 0; set => Data[CardStart + 0x24B] = value ? (byte)1 : (byte)0; }
// Ribbons 0x24C-0x26C
private const int RibbonBytesOffset = 0x24C;
diff --git a/PKHeX.Core/PKM/CK3.cs b/PKHeX.Core/PKM/CK3.cs
index b314b487a..f01d6e43b 100644
--- a/PKHeX.Core/PKM/CK3.cs
+++ b/PKHeX.Core/PKM/CK3.cs
@@ -155,27 +155,27 @@ public sealed class CK3 : G3PKM, IShadowPKM
public override byte CNT_Sheen { get => Data[0xBC]; set => Data[0xBC] = value; }
// Ribbons
- public override bool RibbonChampionG3Hoenn { get => Data[0xBD] == 1; set => Data[0xBD] = value ? 1 : 0; }
- public override bool RibbonWinning { get => Data[0xBE] == 1; set => Data[0xBE] = value ? 1 : 0; }
- public override bool RibbonVictory { get => Data[0xBF] == 1; set => Data[0xBF] = value ? 1 : 0; }
- public override bool RibbonArtist { get => Data[0xC0] == 1; set => Data[0xC0] = value ? 1 : 0; }
- public override bool RibbonEffort { get => Data[0xC1] == 1; set => Data[0xC1] = value ? 1 : 0; }
- public override bool RibbonChampionBattle { get => Data[0xC2] == 1; set => Data[0xC2] = value ? 1 : 0; }
- public override bool RibbonChampionRegional { get => Data[0xC3] == 1; set => Data[0xC3] = value ? 1 : 0; }
- public override bool RibbonChampionNational { get => Data[0xC4] == 1; set => Data[0xC4] = value ? 1 : 0; }
- public override bool RibbonCountry { get => Data[0xC5] == 1; set => Data[0xC5] = value ? 1 : 0; }
- public override bool RibbonNational { get => Data[0xC6] == 1; set => Data[0xC6] = value ? 1 : 0; }
- public override bool RibbonEarth { get => Data[0xC7] == 1; set => Data[0xC7] = value ? 1 : 0; }
- public override bool RibbonWorld { get => Data[0xC8] == 1; set => Data[0xC8] = value ? 1 : 0; }
- public override bool Unused1 { get => ((Data[0xC9] >> 0) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~1) | (value ? 1 : 0)); }
- public override bool Unused2 { get => ((Data[0xC9] >> 1) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~2) | (value ? 2 : 0)); }
- public override bool Unused3 { get => ((Data[0xC9] >> 2) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~4) | (value ? 4 : 0)); }
- public override bool Unused4 { get => ((Data[0xC9] >> 3) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~8) | (value ? 8 : 0)); }
+ public override bool RibbonChampionG3Hoenn { get => Data[0xBD] == 1; set => Data[0xBD] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonWinning { get => Data[0xBE] == 1; set => Data[0xBE] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonVictory { get => Data[0xBF] == 1; set => Data[0xBF] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonArtist { get => Data[0xC0] == 1; set => Data[0xC0] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonEffort { get => Data[0xC1] == 1; set => Data[0xC1] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonChampionBattle { get => Data[0xC2] == 1; set => Data[0xC2] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonChampionRegional { get => Data[0xC3] == 1; set => Data[0xC3] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonChampionNational { get => Data[0xC4] == 1; set => Data[0xC4] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonCountry { get => Data[0xC5] == 1; set => Data[0xC5] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonNational { get => Data[0xC6] == 1; set => Data[0xC6] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonEarth { get => Data[0xC7] == 1; set => Data[0xC7] = value ? (byte)1 : (byte)0; }
+ public override bool RibbonWorld { get => Data[0xC8] == 1; set => Data[0xC8] = value ? (byte)1 : (byte)0; }
+ public override bool Unused1 { get => ((Data[0xC9] >> 0) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~1) | (value ? 1 : 0)); }
+ public override bool Unused2 { get => ((Data[0xC9] >> 1) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~2) | (value ? 2 : 0)); }
+ public override bool Unused3 { get => ((Data[0xC9] >> 2) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~4) | (value ? 4 : 0)); }
+ public override bool Unused4 { get => ((Data[0xC9] >> 3) & 1) == 1; set => Data[0xC9] = (byte)((Data[0xC9] & ~8) | (value ? 8 : 0)); }
public override int PKRS_Strain { get => Data[0xCA] & 0xF; set => Data[0xCA] = (byte)(value & 0xF); }
- public override bool IsEgg { get => Data[0xCB] == 1; set => Data[0xCB] = value ? 1 : 0; }
- public override bool AbilityBit { get => Data[0xCC] == 1; set => Data[0xCC] = value ? 1 : 0; }
- private bool Invalid { get => Data[0xCD] != 0; set => Data[0xCD] = value ? 1 : 0; }
+ public override bool IsEgg { get => Data[0xCB] == 1; set => Data[0xCB] = value ? (byte)1 : (byte)0; }
+ public override bool AbilityBit { get => Data[0xCC] == 1; set => Data[0xCC] = value ? (byte)1 : (byte)0; }
+ private bool Invalid { get => Data[0xCD] != 0; set => Data[0xCD] = value ? (byte)1 : (byte)0; }
public override int MarkValue { get => SwapBits(Data[0xCF], 1, 2); protected set => Data[0xCF] = (byte)SwapBits(value, 1, 2); }
public override int PKRS_Days { get => Math.Max((sbyte)Data[0xD0], (sbyte)0); set => Data[0xD0] = (byte)(value == 0 ? 0xFF : value & 0xF); }
diff --git a/PKHeX.Core/PKM/PB7.cs b/PKHeX.Core/PKM/PB7.cs
index a215968e3..e21ea55b3 100644
--- a/PKHeX.Core/PKM/PB7.cs
+++ b/PKHeX.Core/PKM/PB7.cs
@@ -293,7 +293,7 @@ public override int RelearnMove4
public override int Stat_SPA { get => BitConverter.ToUInt16(Data, 0xFA); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xFA); }
public override int Stat_SPD { get => BitConverter.ToUInt16(Data, 0xFC); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xFC); }
public int Stat_CP { get => BitConverter.ToUInt16(Data, 0xFE); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xFE); }
- public bool Stat_Mega { get => Data[0x100] != 0; set => Data[0x100] = value ? 1 : 0; }
+ public bool Stat_Mega { get => Data[0x100] != 0; set => Data[0x100] = value ? (byte)1 : (byte)0; }
public int Stat_MegaForm { get => Data[0x101]; set => Data[0x101] = (byte)value; }
// 102/103 unused
#endregion
diff --git a/PKHeX.Core/PKM/PK5.cs b/PKHeX.Core/PKM/PK5.cs
index 843abef8c..0744b0fba 100644
--- a/PKHeX.Core/PKM/PK5.cs
+++ b/PKHeX.Core/PKM/PK5.cs
@@ -245,7 +245,7 @@ private static byte[] DecryptParty(byte[] data)
public override int EncounterType { get => Data[0x85]; set => Data[0x85] = (byte)value; }
// 0x86 Unused
public byte PokeStarFame { get => Data[0x87]; set => Data[0x87] = value; }
- public bool IsPokeStar { get => PokeStarFame > 250; set => PokeStarFame = value ? 255 : 0; }
+ public bool IsPokeStar { get => PokeStarFame > 250; set => PokeStarFame = value ? (byte)255 : (byte)0; }
#endregion
#region Battle Stats
diff --git a/PKHeX.Core/PKM/Shared/GBPKML.cs b/PKHeX.Core/PKM/Shared/GBPKML.cs
index ec54cad5a..1e2909b96 100644
--- a/PKHeX.Core/PKM/Shared/GBPKML.cs
+++ b/PKHeX.Core/PKM/Shared/GBPKML.cs
@@ -98,7 +98,7 @@ private void SetStringKeepTerminatorStyle(string value, byte[] exist)
{
// Reset the destination buffer based on the termination style of the existing string.
bool zeroed = Array.IndexOf(exist, (byte)0) != -1;
- byte fill = zeroed ? 0 : StringConverter12.G1TerminatorCode;
+ byte fill = zeroed ? (byte)0 : StringConverter12.G1TerminatorCode;
for (int i = 0; i < exist.Length; i++)
exist[i] = fill;
diff --git a/PKHeX.Core/PKM/Shared/IFormArgument.cs b/PKHeX.Core/PKM/Shared/IFormArgument.cs
index 614d15bcf..1eb1bec1c 100644
--- a/PKHeX.Core/PKM/Shared/IFormArgument.cs
+++ b/PKHeX.Core/PKM/Shared/IFormArgument.cs
@@ -96,7 +96,7 @@ public static void ChangeFormArgument(this IFormArgument f, int species, int for
return;
}
- byte elapsed = max < value ? 0 : (byte)(max - value);
+ byte elapsed = max < value ? (byte)0 : (byte)(max - value);
f.FormArgumentElapsed = elapsed;
if (species == (int)Furfrou)
f.FormArgumentMaximum = Math.Max(f.FormArgumentMaximum, elapsed);
diff --git a/PKHeX.Core/PKM/Util/SpeciesConverter.cs b/PKHeX.Core/PKM/Util/SpeciesConverter.cs
index 67dd8238e..a12a3e4f4 100644
--- a/PKHeX.Core/PKM/Util/SpeciesConverter.cs
+++ b/PKHeX.Core/PKM/Util/SpeciesConverter.cs
@@ -18,7 +18,7 @@ public static class SpeciesConverter
///
/// National Dex ID.
/// Generation 1 species ID.
- public static byte SetG1Species(int species) => (uint)species >= table1_Internal.Length ? 0 : table1_Internal[species];
+ public static byte SetG1Species(int species) => (uint)species >= table1_Internal.Length ? (byte)0 : table1_Internal[species];
///
/// Converts a National Dex ID to Generation 3 species ID.
diff --git a/PKHeX.Core/PKM/XK3.cs b/PKHeX.Core/PKM/XK3.cs
index 8d1323fea..10fbef66d 100644
--- a/PKHeX.Core/PKM/XK3.cs
+++ b/PKHeX.Core/PKM/XK3.cs
@@ -69,7 +69,7 @@ public sealed class XK3 : G3PKM, IShadowPKM
public override uint PID { get => BigEndian.ToUInt32(Data, 0x28); set => BigEndian.GetBytes(value).CopyTo(Data, 0x28); }
// 0x2A-0x2B Unknown
// 0x2C-0x2F Battle Related
- public bool Obedient { get => Data[0x30] == 1; set => Data[0x30] = value ? 1 : 0; }
+ public bool Obedient { get => Data[0x30] == 1; set => Data[0x30] = value ? (byte)1 : (byte)0; }
// 0x31-0x32 Unknown
public int EncounterInfo { get => Data[0x33]; set => Data[0x33] = (byte)value; }
diff --git a/PKHeX.Core/PersonalInfo/PersonalInfoSM.cs b/PKHeX.Core/PersonalInfo/PersonalInfoSM.cs
index 183a64e4b..9e6bfe034 100644
--- a/PKHeX.Core/PersonalInfo/PersonalInfoSM.cs
+++ b/PKHeX.Core/PersonalInfo/PersonalInfoSM.cs
@@ -31,6 +31,6 @@ public override byte[] Write()
public int SpecialZ_Item { get => BitConverter.ToUInt16(Data, 0x4C); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4C); }
public int SpecialZ_BaseMove { get => BitConverter.ToUInt16(Data, 0x4E); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4E); }
public int SpecialZ_ZMove { get => BitConverter.ToUInt16(Data, 0x50); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x50); }
- public bool LocalVariant { get => Data[0x52] == 1; set => Data[0x52] = value ? 1 : 0; }
+ public bool LocalVariant { get => Data[0x52] == 1; set => Data[0x52] = value ? (byte)1 : (byte)0; }
}
}
diff --git a/PKHeX.Core/Saves/SAV1.cs b/PKHeX.Core/Saves/SAV1.cs
index 023ec8634..e12967e46 100644
--- a/PKHeX.Core/Saves/SAV1.cs
+++ b/PKHeX.Core/Saves/SAV1.cs
@@ -163,7 +163,7 @@ protected override byte[] GetFinalData()
// Daycare is read-only, but in case it ever becomes editable, copy it back in.
byte[] rawDC = GetData(GetDaycareSlotOffset(loc: 0, slot: 0), SIZE_STORED);
byte[] dc = new byte[1 + (2 * StringLength) + PokeCrypto.SIZE_1STORED];
- dc[0] = IsDaycareOccupied(0, 0) == true ? 1 : 0;
+ dc[0] = IsDaycareOccupied(0, 0) == true ? (byte)1 : (byte)0;
Array.Copy(rawDC, 2 + 1 + PokeCrypto.SIZE_1PARTY + StringLength, dc, 1, StringLength);
Array.Copy(rawDC, 2 + 1 + PokeCrypto.SIZE_1PARTY, dc, 1 + StringLength, StringLength);
Array.Copy(rawDC, 2 + 1, dc, 1 + (2 * StringLength), PokeCrypto.SIZE_1STORED);
@@ -291,7 +291,7 @@ public override int PlayedHours
public bool PlayedMaximum
{
get => Data[Offsets.PlayTime + 1] != 0;
- set => Data[Offsets.PlayTime + 1] = value ? 1 : 0;
+ set => Data[Offsets.PlayTime + 1] = value ? (byte)1 : (byte)0;
}
public override int PlayedMinutes
diff --git a/PKHeX.Core/Saves/SAV2.cs b/PKHeX.Core/Saves/SAV2.cs
index 016889c30..a4caf56ea 100644
--- a/PKHeX.Core/Saves/SAV2.cs
+++ b/PKHeX.Core/Saves/SAV2.cs
@@ -404,7 +404,7 @@ public int TextSpeed
public bool SaveFileExists
{
get => Data[Offsets.Options + 1] == 1;
- set => Data[Offsets.Options + 1] = value ? 1 : 0;
+ set => Data[Offsets.Options + 1] = value ? (byte)1 : (byte)0;
}
public int TextBoxFrame // 3bits
@@ -432,7 +432,7 @@ public bool SaveFileExists
public bool MenuAccountOn
{
get => Data[Offsets.Options + 5] == 1;
- set => Data[Offsets.Options + 5] = value ? 1 : 0;
+ set => Data[Offsets.Options + 5] = value ? (byte)1 : (byte)0;
}
public override uint Money
diff --git a/PKHeX.Core/Saves/SAV3.cs b/PKHeX.Core/Saves/SAV3.cs
index f2b76b244..1e9d75380 100644
--- a/PKHeX.Core/Saves/SAV3.cs
+++ b/PKHeX.Core/Saves/SAV3.cs
@@ -542,8 +542,8 @@ public byte PokedexNationalMagicFRLG
set => Small[PokeDex + 0x03] = value;
}
- protected const int PokedexNationalUnlockRSE = 0xDA;
- protected const int PokedexNationalUnlockFRLG = 0xDA;
+ protected const byte PokedexNationalUnlockRSE = 0xDA;
+ protected const byte PokedexNationalUnlockFRLG = 0xDA;
protected const ushort PokedexNationalUnlockWorkRSE = 0x0302;
protected const ushort PokedexNationalUnlockWorkFRLG = 0x6258;
diff --git a/PKHeX.Core/Saves/SAV3E.cs b/PKHeX.Core/Saves/SAV3E.cs
index b289ce9fb..51f7132c0 100644
--- a/PKHeX.Core/Saves/SAV3E.cs
+++ b/PKHeX.Core/Saves/SAV3E.cs
@@ -39,8 +39,8 @@ public override bool NationalDex
get => PokedexNationalMagicRSE == PokedexNationalUnlockRSE;
set
{
- PokedexMode = value ? 1 : 0; // mode
- PokedexNationalMagicRSE = value ? PokedexNationalUnlockRSE : 0; // magic
+ PokedexMode = value ? (byte)1 : (byte)0; // mode
+ PokedexNationalMagicRSE = value ? PokedexNationalUnlockRSE : (byte)0; // magic
SetEventFlag(0x896, value);
SetEventConst(0x46, PokedexNationalUnlockWorkRSE);
}
@@ -196,7 +196,7 @@ public override MysteryEvent3 MysteryEvent
protected override int SeenOffset3 => 0x3B24;
#endregion
- public uint EXTRADATA_SENTINEL = 0x0000B39D;
+ private const uint EXTRADATA_SENTINEL = 0x0000B39D;
private const int OFS_BV = 31 * 0x1000; // last sector of the save
public bool HasBattleVideo => Data.Length > SaveUtil.SIZE_G3RAWHALF && BitConverter.ToUInt32(Data, OFS_BV) == EXTRADATA_SENTINEL;
diff --git a/PKHeX.Core/Saves/SAV3FRLG.cs b/PKHeX.Core/Saves/SAV3FRLG.cs
index 8d5f9d2c5..d855d283b 100644
--- a/PKHeX.Core/Saves/SAV3FRLG.cs
+++ b/PKHeX.Core/Saves/SAV3FRLG.cs
@@ -48,7 +48,7 @@ public override bool NationalDex
get => PokedexNationalMagicFRLG == PokedexNationalUnlockFRLG;
set
{
- PokedexNationalMagicFRLG = value ? PokedexNationalUnlockFRLG : 0; // magic
+ PokedexNationalMagicFRLG = value ? PokedexNationalUnlockFRLG : (byte)0; // magic
SetEventFlag(0x840, value);
SetEventConst(0x4E, PokedexNationalUnlockWorkFRLG);
}
diff --git a/PKHeX.Core/Saves/SAV3RS.cs b/PKHeX.Core/Saves/SAV3RS.cs
index 980ef4bf1..5b2bf9f85 100644
--- a/PKHeX.Core/Saves/SAV3RS.cs
+++ b/PKHeX.Core/Saves/SAV3RS.cs
@@ -39,8 +39,8 @@ public override bool NationalDex
get => PokedexNationalMagicRSE == PokedexNationalUnlockRSE;
set
{
- PokedexMode = value ? 1 : 0; // mode
- PokedexNationalMagicRSE = value ? PokedexNationalUnlockRSE : 0; // magic
+ PokedexMode = value ? (byte)1 : (byte)0; // mode
+ PokedexNationalMagicRSE = value ? PokedexNationalUnlockRSE : (byte)0; // magic
SetEventFlag(0x836, value);
SetEventConst(0x46, PokedexNationalUnlockWorkRSE);
}
diff --git a/PKHeX.Core/Saves/SAV4.cs b/PKHeX.Core/Saves/SAV4.cs
index 3553d1cce..a195289a9 100644
--- a/PKHeX.Core/Saves/SAV4.cs
+++ b/PKHeX.Core/Saves/SAV4.cs
@@ -608,22 +608,22 @@ public int DexUpgraded
switch (Version)
{
case GameVersion.DP:
- General[0x1413] = value == 4 ? 1 : 0;
- General[0x1415] = value >= 3 ? 1 : 0;
- General[0x1404] = value >= 2 ? 1 : 0;
- General[0x1414] = value >= 1 ? 1 : 0;
+ General[0x1413] = value == 4 ? (byte)1 : (byte)0;
+ General[0x1415] = value >= 3 ? (byte)1 : (byte)0;
+ General[0x1404] = value >= 2 ? (byte)1 : (byte)0;
+ General[0x1414] = value >= 1 ? (byte)1 : (byte)0;
break;
case GameVersion.HGSS:
- General[0x15ED] = value == 3 ? 1 : 0;
- General[0x15EF] = value >= 2 ? 1 : 0;
- General[0x15EE] = value >= 1 ? 1 : 0;
+ General[0x15ED] = value == 3 ? (byte)1 : (byte)0;
+ General[0x15EF] = value >= 2 ? (byte)1 : (byte)0;
+ General[0x15EE] = value >= 1 ? (byte)1 : (byte)0;
General[0x10D1] = (byte)((General[0x10D1] & ~8) | (value >= 1 ? 8 : 0));
break;
case GameVersion.Pt:
- General[0x1641] = value == 4 ? 1 : 0;
- General[0x1643] = value >= 3 ? 1 : 0;
- General[0x1640] = value >= 2 ? 1 : 0;
- General[0x1642] = value >= 1 ? 1 : 0;
+ General[0x1641] = value == 4 ? (byte)1 : (byte)0;
+ General[0x1643] = value >= 3 ? (byte)1 : (byte)0;
+ General[0x1640] = value >= 2 ? (byte)1 : (byte)0;
+ General[0x1642] = value >= 1 ? (byte)1 : (byte)0;
break;
default: return;
}
diff --git a/PKHeX.Core/Saves/SAV4BR.cs b/PKHeX.Core/Saves/SAV4BR.cs
index 15584aa21..b05b78e44 100644
--- a/PKHeX.Core/Saves/SAV4BR.cs
+++ b/PKHeX.Core/Saves/SAV4BR.cs
@@ -244,7 +244,7 @@ protected override void SetPKM(PKM pkm, bool isParty = false)
protected override void SetPartyValues(PKM pkm, bool isParty)
{
- pkm.Sanity = isParty ? 0xC000 : 0x4000;
+ pkm.Sanity = isParty ? (ushort)0xC000 : (ushort)0x4000;
}
public static byte[] DecryptPBRSaveData(byte[] input)
diff --git a/PKHeX.Core/Saves/SAV5.cs b/PKHeX.Core/Saves/SAV5.cs
index 0e7d26a98..19e76edac 100644
--- a/PKHeX.Core/Saves/SAV5.cs
+++ b/PKHeX.Core/Saves/SAV5.cs
@@ -101,7 +101,7 @@ public override int PartyCount
public bool BattleBoxLocked
{
get => Data[BattleBoxOffset + 0x358] != 0; // wifi/live
- set => Data[BattleBoxOffset + 0x358] = value ? 1 : 0;
+ set => Data[BattleBoxOffset + 0x358] = value ? (byte)1 : (byte)0;
}
protected override void SetPKM(PKM pkm, bool isParty = false)
@@ -148,7 +148,7 @@ public override byte[] SetString(string value, int maxLength, int PadToSize = 0,
private bool CGearSkinPresent
{
get => Data[CGearSkinInfoOffset + 2] == 1;
- set => Data[CGearSkinInfoOffset + 2] = Data[PlayerData.Offset + (this is SAV5B2W2 ? 0x6C : 0x54)] = value ? 1 : 0;
+ set => Data[CGearSkinInfoOffset + 2] = Data[PlayerData.Offset + (this is SAV5B2W2 ? 0x6C : 0x54)] = value ? (byte)1 : (byte)0;
}
public byte[] CGearSkinData
diff --git a/PKHeX.Core/Saves/SAV6AO.cs b/PKHeX.Core/Saves/SAV6AO.cs
index 3fd2af908..47288dc9e 100644
--- a/PKHeX.Core/Saves/SAV6AO.cs
+++ b/PKHeX.Core/Saves/SAV6AO.cs
@@ -154,7 +154,7 @@ public override void SetDaycareEXP(int loc, int slot, uint EXP)
public override void SetDaycareOccupied(int loc, int slot, bool occupied)
{
int ofs = loc == 0 ? DaycareOffset : Daycare2;
- Data[ofs + ((SIZE_STORED + 8) * slot)] = occupied ? 1 : 0;
+ Data[ofs + ((SIZE_STORED + 8) * slot)] = occupied ? (byte)1 : (byte)0;
}
public override void SetDaycareRNGSeed(int loc, string seed)
@@ -172,7 +172,7 @@ public override void SetDaycareRNGSeed(int loc, string seed)
public override void SetDaycareHasEgg(int loc, bool hasEgg)
{
int ofs = loc == 0 ? DaycareOffset : Daycare2;
- Data[ofs + 0x1E0] = hasEgg ? 1 : 0;
+ Data[ofs + 0x1E0] = hasEgg ? (byte)1 : (byte)0;
}
public override string JPEGTitle => HasJPPEGData ? string.Empty : StringConverter.GetString6(Data, JPEG, 0x1A);
diff --git a/PKHeX.Core/Saves/SAV6XY.cs b/PKHeX.Core/Saves/SAV6XY.cs
index ae846077b..fae6494ae 100644
--- a/PKHeX.Core/Saves/SAV6XY.cs
+++ b/PKHeX.Core/Saves/SAV6XY.cs
@@ -93,8 +93,8 @@ private void Initialize()
public override int GetDaycareSlotOffset(int loc, int slot) => DaycareOffset + 8 + (slot * (SIZE_STORED + 8));
public override bool? IsDaycareHasEgg(int loc) => Data[DaycareOffset + 0x1E0] == 1;
- public override void SetDaycareHasEgg(int loc, bool hasEgg) => Data[DaycareOffset + 0x1E0] = hasEgg ? 1 : 0;
- public override void SetDaycareOccupied(int loc, int slot, bool occupied) => Data[DaycareOffset + ((SIZE_STORED + 8) * slot)] = occupied ? 1 : 0;
+ public override void SetDaycareHasEgg(int loc, bool hasEgg) => Data[DaycareOffset + 0x1E0] = hasEgg ? (byte)1 : (byte)0;
+ public override void SetDaycareOccupied(int loc, int slot, bool occupied) => Data[DaycareOffset + ((SIZE_STORED + 8) * slot)] = occupied ? (byte)1 : (byte)0;
public override void SetDaycareEXP(int loc, int slot, uint EXP) => BitConverter.GetBytes(EXP).CopyTo(Data, DaycareOffset + 4 + ((SIZE_STORED + 8) * slot));
public override string GetDaycareRNGSeed(int loc)
diff --git a/PKHeX.Core/Saves/Substructures/Gen3/Roamer3.cs b/PKHeX.Core/Saves/Substructures/Gen3/Roamer3.cs
index f2514ca19..ff431929f 100644
--- a/PKHeX.Core/Saves/Substructures/Gen3/Roamer3.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen3/Roamer3.cs
@@ -59,7 +59,7 @@ public int CurrentLevel
public byte CNT_Smart { get => Data[Offset + 0x11]; set => Data[Offset + 0x11] = value; }
public byte CNT_Tough { get => Data[Offset + 0x12]; set => Data[Offset + 0x12] = value; }
public byte CNT_Sheen { get => 0; set { } }
- public bool Active { get => Data[Offset + 0x13] == 1; set => Data[Offset + 0x13] = value ? 1 : 0; }
+ public bool Active { get => Data[Offset + 0x13] == 1; set => Data[Offset + 0x13] = value ? (byte)1 : (byte)0; }
// Derived Properties
private int IV_HP { get => (int)(IV32 >> 00) & 0x1F; set => IV32 = (uint)((IV32 & ~(0x1F << 00)) | (uint)((value > 31 ? 31 : value) << 00)); }
diff --git a/PKHeX.Core/Saves/Substructures/Gen5/EntreeForest.cs b/PKHeX.Core/Saves/Substructures/Gen5/EntreeForest.cs
index 93f55b733..e40857bc7 100644
--- a/PKHeX.Core/Saves/Substructures/Gen5/EntreeForest.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen5/EntreeForest.cs
@@ -61,7 +61,7 @@ public EntreeSlot[] Slots
public bool Unlock9thArea
{
get => Data[0x848] == 1;
- set => Data[0x848] = value ? 1 : 0;
+ set => Data[0x848] = value ? (byte)1 : (byte)0;
}
///
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs b/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs
index 77f1722f4..890692868 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs
@@ -125,7 +125,7 @@ public void UnlockAllTeams()
}
public bool GetIsTeamLocked(int team) => Data[Offset + PCBackgrounds - TeamCount - team] == 1;
- public void SetIsTeamLocked(int team, bool value) => Data[Offset + PCBackgrounds - TeamCount - team] = value ? 1 : 0;
+ public void SetIsTeamLocked(int team, bool value) => Data[Offset + PCBackgrounds - TeamCount - team] = value ? (byte)1 : (byte)0;
public string this[int i]
{
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/Daycare7.cs b/PKHeX.Core/Saves/Substructures/Gen7/Daycare7.cs
index 569a952d2..6108d0214 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/Daycare7.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/Daycare7.cs
@@ -14,7 +14,7 @@ public bool GetIsOccupied(int slot)
public void SetOccupied(int slot, bool occupied)
{
- Data[Offset + ((PokeCrypto.SIZE_6STORED + 1) * slot)] = occupied ? 1 : 0;
+ Data[Offset + ((PokeCrypto.SIZE_6STORED + 1) * slot)] = occupied ? (byte)1 : (byte)0;
}
public int GetDaycareSlotOffset(int slot)
@@ -25,7 +25,7 @@ public int GetDaycareSlotOffset(int slot)
public bool HasEgg
{
get => Data[Offset + 0x1D8] == 1;
- set => Data[Offset + 0x1D8] = value ? 1 : 0;
+ set => Data[Offset + 0x1D8] = value ? (byte)1 : (byte)0;
}
public string RNGSeed
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/FestaFacility.cs b/PKHeX.Core/Saves/Substructures/Gen7/FestaFacility.cs
index 139518251..92ae1c55b 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/FestaFacility.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/FestaFacility.cs
@@ -20,7 +20,7 @@ public FestaFacility(SAV7 sav, int index)
public int Type { get => Data[0x00]; set => Data[0x00] = (byte)value; }
public int Color { get => Data[0x01]; set => Data[0x01] = (byte)value; }
- public bool IsIntroduced { get => Data[0x02] != 0; set => Data[0x02] = value ? 1 : 0; }
+ public bool IsIntroduced { get => Data[0x02] != 0; set => Data[0x02] = value ? (byte)1 : (byte)0; }
public int Gender { get => Data[0x03]; set => Data[0x03] = (byte)value; }
public string OT_Name { get => StringConverter.GetString7(Data, 0x04, 0x1A); set => StringConverter.SetString7(value, 12, Language).CopyTo(Data, 0x04); }
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/JoinFesta7.cs b/PKHeX.Core/Saves/Substructures/Gen7/JoinFesta7.cs
index 0013f4e25..fa5454a28 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/JoinFesta7.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/JoinFesta7.cs
@@ -45,7 +45,7 @@ public string FestivalPlazaName
public void SetFestaPhraseUnlocked(int index, bool value)
{
if (GetFestaPhraseUnlocked(index) != value)
- Data[Offset + 0x2A50 + index] = value ? 1 : 0;
+ Data[Offset + 0x2A50 + index] = value ? (byte)1 : (byte)0;
}
public byte GetFestPrizeReceived(int index) => Data[Offset + 0x53C + index];
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/QR7.cs b/PKHeX.Core/Saves/Substructures/Gen7/QR7.cs
index 3d0b061ba..fe876563f 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/QR7.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/QR7.cs
@@ -62,8 +62,8 @@ private static byte[] GetRawQR(int species, int form, bool shiny, int gender)
basedata[0x2A] = (byte)form;
basedata[0x2B] = (byte)gender;
- basedata[0x2C] = shiny ? 1 : 0;
- basedata[0x2D] = biGender ? 1 : 0;
+ basedata[0x2C] = shiny ? (byte)1 : (byte)0;
+ basedata[0x2D] = biGender ? (byte)1 : (byte)0;
return basedata;
}
diff --git a/PKHeX.Core/Saves/Substructures/Gen7/WormholeInfoReader.cs b/PKHeX.Core/Saves/Substructures/Gen7/WormholeInfoReader.cs
index 167ae9587..8852a3475 100644
--- a/PKHeX.Core/Saves/Substructures/Gen7/WormholeInfoReader.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen7/WormholeInfoReader.cs
@@ -10,7 +10,7 @@ public sealed class WormholeInfoReader
public bool WormholeShininess // 0x4535 = Misc (0x4400 in USUM) + 0x0135
{
get => SAV.Data[SAV.Misc.Offset + 0x0135] == 1;
- set => SAV.Data[SAV.Misc.Offset + 0x0135] = value ? 1 : 0;
+ set => SAV.Data[SAV.Misc.Offset + 0x0135] = value ? (byte)1 : (byte)0;
}
public const int WormholeSlotMax = 15;
diff --git a/PKHeX.Core/Saves/Substructures/Gen8/TitleScreen8.cs b/PKHeX.Core/Saves/Substructures/Gen8/TitleScreen8.cs
index 84e9fdc31..9b9839601 100644
--- a/PKHeX.Core/Saves/Substructures/Gen8/TitleScreen8.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen8/TitleScreen8.cs
@@ -67,7 +67,7 @@ public int Gender
public bool IsShiny
{
get => Data[Offset + 0xC] != 0;
- set => Data[Offset + 0xC] = value ? 1 : 0;
+ set => Data[Offset + 0xC] = value ? (byte)1 : (byte)0;
}
public uint EncryptionConstant
diff --git a/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs b/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs
index afb685ce8..6fc945cfb 100644
--- a/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs
+++ b/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs
@@ -89,19 +89,19 @@ public int CaughtPokemon
public bool PokeDexComplete
{
get => Data[Offset + 0x30] == 1;
- set => Data[Offset + 0x30] = value ? 1 : 0;
+ set => Data[Offset + 0x30] = value ? (byte)1 : (byte)0;
}
public bool ArmorDexComplete
{
get => Data[Offset + 0x1B4] == 1;
- set => Data[Offset + 0x1B4] = value ? 1 : 0;
+ set => Data[Offset + 0x1B4] = value ? (byte)1 : (byte)0;
}
public bool CrownDexComplete
{
get => Data[Offset + 0x1B5] == 1;
- set => Data[Offset + 0x1B5] = value ? 1 : 0;
+ set => Data[Offset + 0x1B5] = value ? (byte)1 : (byte)0;
}
public int Gender
@@ -307,7 +307,7 @@ public int Gender
public bool IsShiny
{
get => Data[Offset + 0xC] != 0;
- set => Data[Offset + 0xC] = value ? 1 : 0;
+ set => Data[Offset + 0xC] = value ? (byte)1 : (byte)0;
}
public uint EncryptionConstant
diff --git a/PKHeX.Core/Saves/Substructures/Mail/Mail2.cs b/PKHeX.Core/Saves/Substructures/Mail/Mail2.cs
index 038d5908d..b8efccffd 100644
--- a/PKHeX.Core/Saves/Substructures/Mail/Mail2.cs
+++ b/PKHeX.Core/Saves/Substructures/Mail/Mail2.cs
@@ -23,7 +23,7 @@ public override void SetMessage(string line1, string line2)
if (US)
{
StringConverter12.SetString1(line2, 0x10, false, 0x10, 0x50).CopyTo(Data, 0x11);
- StringConverter12.SetString1(line1, 0x10, false, 0x10, Data.Skip(0x11).Take(0x10).All(v => v == 0x50) ? 0x50 : 0x7F).CopyTo(Data, 0);
+ StringConverter12.SetString1(line1, 0x10, false, 0x10, Data.Skip(0x11).Take(0x10).All(v => v == 0x50) ? (byte)0x50 : (byte)0x7F).CopyTo(Data, 0);
Data[0x10] = 0x4E;
}
}
diff --git a/PKHeX.Core/Saves/Substructures/Mail/Mail4.cs b/PKHeX.Core/Saves/Substructures/Mail/Mail4.cs
index f3da6d726..4af7ba943 100644
--- a/PKHeX.Core/Saves/Substructures/Mail/Mail4.cs
+++ b/PKHeX.Core/Saves/Substructures/Mail/Mail4.cs
@@ -31,7 +31,7 @@ private void ResetData()
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 4; x++)
- SetMessage(y, x, x == 1 ? 0 : 0xFFFF);
+ SetMessage(y, x, x == 1 ? (ushort)0 : (ushort)0xFFFF);
}
}
diff --git a/PKHeX.Core/Saves/Substructures/Mail/Mail5.cs b/PKHeX.Core/Saves/Substructures/Mail/Mail5.cs
index 2468b19cc..5ac2ac699 100644
--- a/PKHeX.Core/Saves/Substructures/Mail/Mail5.cs
+++ b/PKHeX.Core/Saves/Substructures/Mail/Mail5.cs
@@ -28,7 +28,7 @@ private void ResetData()
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 4; x++)
- SetMessage(y, x, x == 1 ? 0 : 0xFFFF);
+ SetMessage(y, x, x == 1 ? (ushort)0 : (ushort)0xFFFF);
}
}
diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs
index c574b3710..df1d715e2 100644
--- a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs
+++ b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Misc5.cs
@@ -497,7 +497,7 @@ private void LB_FunfestMissions_SelectedIndexChanged(object sender, EventArgs e)
private void CHK_FMNew_CheckedChanged(object sender, EventArgs e)
{
if (editing) return;
- SetFMVal(31, 1, CHK_FMNew.Checked ? 1 : 0);
+ SetFMVal(31, 1, CHK_FMNew.Checked ? 1u : 0);
}
private void CB_FMLevel_SelectedIndexChanged(object sender, EventArgs e)
diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_HallOfFame7.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_HallOfFame7.cs
index f3a9edfec..4ce9fef68 100644
--- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_HallOfFame7.cs
+++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_HallOfFame7.cs
@@ -61,7 +61,7 @@ private void B_Close_Click(object sender, EventArgs e)
int ofs = SAV.HoF;
SAV.Data[ofs] &= 0xFE;
- SAV.Data[ofs] |= CHK_Flag.Checked ? 1 : 0;
+ SAV.Data[ofs] |= CHK_Flag.Checked ? (byte)1 : (byte)0;
BitConverter.GetBytes((ushort)NUD_Count.Value).CopyTo(SAV.Data, ofs + 2);
for (int i = 0; i < entries.Length; i++)
{