Skip to content

Commit

Permalink
Fixed con files
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Jun 25, 2023
1 parent cd63eb7 commit d5ebe0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Assets/Script/Audio/Bass/BassAudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ public void LoadMogg(ExtractedConSongEntry exConSong, float speed, params SongSt
// Process MOGG data
byte[] moggArray = exConSong.LoadMoggFile();

if (!exConSong.IsMoggUnencrypted()) {
// Double check MOGG version
if (BitConverter.ToUInt32(moggArray, 0) != 0x0A && BitConverter.ToUInt32(moggArray, 0) != 0xF0) {
throw new Exception("Original unencrypted mogg replaced by an encrypted mogg");
}

Expand Down
7 changes: 6 additions & 1 deletion Assets/Script/Song/Scanning/SongScanThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,12 @@ private static ScanResult ScanConSong(string cache, ExtractedConSongEntry file)
return ScanResult.NotASong;
}

if (string.IsNullOrEmpty(file.MoggPath)) {
// Check if audio files
if (file is ConSongEntry con) {
if (con.MoggIndex == -1) {
return ScanResult.NoAudioFile;
}
} else if (string.IsNullOrEmpty(file.MoggPath)) {
return ScanResult.NoAudioFile;
}

Expand Down
3 changes: 2 additions & 1 deletion Assets/Script/Song/Types/ConSongEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ public override byte[] LoadMidiFile() {
}

public override byte[] LoadMoggFile() {
if (!UsingUpdateMogg)
if (!UsingUpdateMogg) {
return conFile.LoadSubFile(MoggIndex);
}
return base.LoadMoggFile();
}

Expand Down

0 comments on commit d5ebe0b

Please sign in to comment.