From 0efa910b5883663c836652f8fe134e845fa0b679 Mon Sep 17 00:00:00 2001 From: goaaats Date: Mon, 7 Feb 2022 13:30:40 +0100 Subject: [PATCH] Don't actually change song IDs for TJA --- TakoTako/MusicPatch.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TakoTako/MusicPatch.cs b/TakoTako/MusicPatch.cs index 9061b97..00fc34a 100644 --- a/TakoTako/MusicPatch.cs +++ b/TakoTako/MusicPatch.cs @@ -373,20 +373,21 @@ public class MusicPatch song.genreNo = 7; } + var tempId = song.id; if (isTjaSong) { - song.id = song.songName?.text + song.songSubtitle?.text + song.songDetail?.text; - if (string.IsNullOrEmpty(song.id)) + tempId = song.songName?.text + song.songSubtitle?.text + song.songDetail?.text; + if (string.IsNullOrEmpty(tempId)) throw new Exception($"Song at {directory} does not have name, subtitle or detail text"); - song.id += song.fumenOffsetPos + song.previewPos; + tempId += song.fumenOffsetPos + song.previewPos; } song.SongName = song.id; song.FolderPath = directory; // Clip off the last bit of the hash to make sure that the number is positive. This will lead to more collisions, but we should be fine. - song.uniqueId = (int)(MurmurHash2.Hash(song.id) & 0xFFFF_FFF); + song.uniqueId = (int)(MurmurHash2.Hash(tempId) & 0xFFFF_FFF); if (song.uniqueId <= SaveDataMax) song.uniqueId += SaveDataMax;