From b369af64c7c96cd713d0a00fae97e3e5952d55de Mon Sep 17 00:00:00 2001 From: Nifyr Date: Wed, 14 Feb 2024 12:59:11 +0100 Subject: [PATCH] Limit asset rename to origin GameObject in bundle cloning --- PokemonInserter.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PokemonInserter.cs b/PokemonInserter.cs index 1a3e38e..fb1e72f 100644 --- a/PokemonInserter.cs +++ b/PokemonInserter.cs @@ -1212,8 +1212,11 @@ private CloneMode DuplicateAssetBundle(string srcPath, string dstPath, CloneMode string m_Name = gameObject["m_Name"].value.AsString(); AssetFileInfoEx afie = afi.table.GetAssetInfo(m_Name, (int)AssetClassID.GameObject); - m_Name = ReplacePM(m_Name, refPM); - gameObject["m_Name"].GetValue().Set(m_Name); + if (Regex.Match(m_Name, @"\Apm\d{4}_\d{2}_\d{2}\z").Success) + { + m_Name = ReplacePM(m_Name, refPM); + gameObject["m_Name"].GetValue().Set(m_Name); + } byte[] b = gameObject.WriteToByteArray(); AssetsReplacerFromMemory arfm = new(0, afie.index, (int)afie.curFileType, AssetHelper.GetScriptIndex(afi.file, afie), b);