Skip to content

Commit da3cc6f

Browse files
committed
Fix crash when using music.mp3
1 parent b42035a commit da3cc6f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CloneDash/Compatibility/CustomAlbums/CustomCharts.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ public CustomChartsSong(string pathID, string path) {
113113

114114
protected override MusicTrack ProduceAudioTrack() {
115115
if (Archive != null) {
116-
var demoBytes = GetByteArray(Archive, "music.ogg");
117-
return EngineCore.Level.Sounds.LoadMusicFromMemory(demoBytes);
116+
var musicBytes = GetByteArray(Archive, "music.ogg");
117+
if (musicBytes.Length == 0) // Try to find mp3 instead
118+
musicBytes = GetByteArray(Archive, "music.mp3");
119+
return EngineCore.Level.Sounds.LoadMusicFromMemory(musicBytes);
118120
}
119121
else {
120122
return WebChart.GetMusicTrack(false); // this wont even run

0 commit comments

Comments
 (0)