Skip to content

Commit

Permalink
Limit asset rename to origin GameObject in bundle cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
Nifyr committed Feb 14, 2024
1 parent 90c0e7e commit b369af6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PokemonInserter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b369af6

Please sign in to comment.