From 91e75728832fbe9fb4cf2a089f5e548d0c565705 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Thu, 23 Mar 2023 23:15:47 -0400 Subject: [PATCH] Revert "Remove duplicate song saving (#356)" (#358) This reverts commit 33f17dcbadbc56cef17854d3b0a94f2d96b837e1. --- Assets/Scripts/LevelEditor/Editor.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 7e86d81d..85547c75 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -382,7 +382,7 @@ namespace HeavenStudio.Editor private void SaveRemixFile(string path) { - using (FileStream zipFile = File.Open(path, FileMode.OpenOrCreate)) + using (FileStream zipFile = File.Open(path, FileMode.Create)) { using (var archive = new ZipArchive(zipFile, ZipArchiveMode.Update)) { @@ -390,14 +390,12 @@ namespace HeavenStudio.Editor using (var zipStream = levelFile.Open()) zipStream.Write(Encoding.UTF8.GetBytes(GetJson()), 0, Encoding.UTF8.GetBytes(GetJson()).Length); - if ((MusicBytes != null) && (changedMusic == true)) + if (MusicBytes != null) { - Debug.Log("Saving music..."); var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression); using (var zipStream = musicFile.Open()) zipStream.Write(MusicBytes, 0, MusicBytes.Length); } - } currentRemixPath = path;