From 2e6364dceb043eeb7547ed2ae481d0f2fb1bd260 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 10 Mar 2022 18:00:45 -0800 Subject: [PATCH] Fix pk2->pk1 nickname copy nobody noticed until I did --- PKHeX.Core/PKM/PK2.cs | 2 +- PKHeX.Core/PKM/Shared/GBPKML.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/PKM/PK2.cs b/PKHeX.Core/PKM/PK2.cs index 3b016163f..0137b84c9 100644 --- a/PKHeX.Core/PKM/PK2.cs +++ b/PKHeX.Core/PKM/PK2.cs @@ -122,7 +122,7 @@ public PK1 ConvertToPK1() } // Status = 0 OT_Trash.CopyTo(pk1.OT_Trash); - Nickname_Trash.CopyTo(pk1.OT_Trash); + Nickname_Trash.CopyTo(pk1.Nickname_Trash); pk1.ClearInvalidMoves(); diff --git a/PKHeX.Core/PKM/Shared/GBPKML.cs b/PKHeX.Core/PKM/Shared/GBPKML.cs index 4b546f1b2..27841f0e0 100644 --- a/PKHeX.Core/PKM/Shared/GBPKML.cs +++ b/PKHeX.Core/PKM/Shared/GBPKML.cs @@ -108,8 +108,7 @@ private void SetStringKeepTerminatorStyle(ReadOnlySpan value, Span e // Reset the destination buffer based on the termination style of the existing string. bool zeroed = exist.IndexOf((byte)0) != -1; byte fill = zeroed ? (byte)0 : StringConverter12.G1TerminatorCode; - for (int i = 0; i < exist.Length; i++) - exist[i] = fill; + exist.Fill(fill); int finalLength = Math.Min(value.Length + 1, exist.Length); SetString(value, exist, finalLength);