Skip to content

Commit

Permalink
Bug fix regarding audio exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nifyr committed Mar 13, 2022
1 parent 7c25602 commit 3e9624c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ public byte[] GetDelphisMainBuffer()
return File.ReadAllBytes(fileArchive[delphisMainPath].fileLocation);
}

/// <summary>
/// Makes it so the audioCollection data is included when exporting.
/// </summary>
public void CommitAudio()
{
fileArchive[delphisMainPath].fileSource = FileSource.App;
Expand All @@ -309,7 +312,7 @@ private static void ExportFile(FileData fd, string modRoot)
Directory.CreateDirectory(modRoot + "\\" + Path.GetDirectoryName(fd.gamePath));
string newLocation = modRoot + "\\" + fd.gamePath;

if (Path.GetFileName(fd.gamePath) == "Delphis_Main.bnk")
if (fd.fileSource == FileSource.App && Path.GetFileName(fd.gamePath) == "Delphis_Main.bnk")
{
FileStream fs = File.Create(newLocation);
fs.Write(GlobalData.gameData.audioCollection.delphisMainBuffer, 0, GlobalData.gameData.audioCollection.delphisMainBuffer.Length);
Expand Down

0 comments on commit 3e9624c

Please sign in to comment.