From 6304ef2006f87dce227f2e8ae97063e00d2cf238 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 10 Oct 2021 16:16:56 -0700 Subject: [PATCH] Fix gets for u16 char widths oops Only gen1/2 have trash exposed for OT, so I guess I can just leave these. --- PKHeX.Core/Saves/SAV4DP.cs | 6 +++--- PKHeX.Core/Saves/SAV4HGSS.cs | 6 +++--- PKHeX.Core/Saves/SAV4Pt.cs | 6 +++--- PKHeX.Core/Saves/SAV5B2W2.cs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PKHeX.Core/Saves/SAV4DP.cs b/PKHeX.Core/Saves/SAV4DP.cs index f261d6e92..5e6d9d993 100644 --- a/PKHeX.Core/Saves/SAV4DP.cs +++ b/PKHeX.Core/Saves/SAV4DP.cs @@ -148,14 +148,14 @@ private void SetActiveGiftFlags(IReadOnlyList gifts) public override string Rival { - get => GetString(0x25A8, OTLength); + get => GetString(0x25A8, OTLength * 2); set => SetString(value, OTLength).CopyTo(Data, 0x25A8); } public override Span Rival_Trash { - get => Data.AsSpan(0x25A8, OTLength); - set { if (value.Length == OTLength) value.CopyTo(Data.AsSpan(0x25A8)); } + get => Data.AsSpan(0x25A8, OTLength * 2); + set { if (value.Length == OTLength * 2) value.CopyTo(Data.AsSpan(0x25A8)); } } public override int X2 { get => BitConverter.ToUInt16(General, 0x25FA); set => BitConverter.GetBytes((ushort)value).CopyTo(General, 0x25FA); } diff --git a/PKHeX.Core/Saves/SAV4HGSS.cs b/PKHeX.Core/Saves/SAV4HGSS.cs index 3086ca483..fb1400a20 100644 --- a/PKHeX.Core/Saves/SAV4HGSS.cs +++ b/PKHeX.Core/Saves/SAV4HGSS.cs @@ -157,14 +157,14 @@ public override IReadOnlyList Inventory public override string Rival { - get => GetString(0x22D4, OTLength); + get => GetString(0x22D4, OTLength * 2); set => SetString(value, OTLength).CopyTo(Data, 0x22D4); } public override Span Rival_Trash { - get => Data.AsSpan(0x22D4, OTLength); - set { if (value.Length == OTLength) value.CopyTo(Data.AsSpan(0x22D4)); } + get => Data.AsSpan(0x22D4, OTLength * 2); + set { if (value.Length == OTLength * 2) value.CopyTo(Data.AsSpan(0x22D4)); } } public override int X2 { get => BitConverter.ToUInt16(General, 0x236E); set => BitConverter.GetBytes((ushort)value).CopyTo(General, 0x236E); } diff --git a/PKHeX.Core/Saves/SAV4Pt.cs b/PKHeX.Core/Saves/SAV4Pt.cs index 2138fb720..408fa1397 100644 --- a/PKHeX.Core/Saves/SAV4Pt.cs +++ b/PKHeX.Core/Saves/SAV4Pt.cs @@ -114,14 +114,14 @@ public override IReadOnlyList Inventory public override string Rival { - get => GetString(0x27E8, OTLength); + get => GetString(0x27E8, OTLength * 2); set => SetString(value, OTLength).CopyTo(Data, 0x27E8); } public override Span Rival_Trash { - get => Data.AsSpan(0x27E8, OTLength); - set { if (value.Length == OTLength) value.CopyTo(Data.AsSpan(0x27E8)); } + get => Data.AsSpan(0x27E8, OTLength * 2); + set { if (value.Length == OTLength * 2) value.CopyTo(Data.AsSpan(0x27E8)); } } public override int X2 { get => BitConverter.ToUInt16(General, 0x287E); set => BitConverter.GetBytes((ushort)value).CopyTo(General, 0x287E); } diff --git a/PKHeX.Core/Saves/SAV5B2W2.cs b/PKHeX.Core/Saves/SAV5B2W2.cs index 1c3ac913c..b6ebdf4ba 100644 --- a/PKHeX.Core/Saves/SAV5B2W2.cs +++ b/PKHeX.Core/Saves/SAV5B2W2.cs @@ -60,14 +60,14 @@ private void Initialize() public string Rival { - get => GetString(0x23BA4, OTLength); + get => GetString(0x23BA4, OTLength * 2); set => SetString(value, OTLength).CopyTo(Data, 0x23BA4); } public Span Rival_Trash { - get => Data.AsSpan(0x23BA4, OTLength); - set { if (value.Length == OTLength) value.CopyTo(Data.AsSpan(0x23BA4)); } + get => Data.AsSpan(0x23BA4, OTLength * 2); + set { if (value.Length == OTLength * 2) value.CopyTo(Data.AsSpan(0x23BA4)); } } } }