From 4a2837a8243567cafc9c583b876ddc3c6ea28966 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 24 Jul 2022 21:41:19 -0400 Subject: [PATCH] Log when audio type handler messes up --- NewHorizons/Handlers/AudioTypeHandler.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/AudioTypeHandler.cs b/NewHorizons/Handlers/AudioTypeHandler.cs index e3f3a66c..326b2760 100644 --- a/NewHorizons/Handlers/AudioTypeHandler.cs +++ b/NewHorizons/Handlers/AudioTypeHandler.cs @@ -30,7 +30,18 @@ namespace NewHorizons.Handlers Logger.LogVerbose($"Adding all custom AudioTypes to the library"); var library = Locator.GetAudioManager()._libraryAsset; - library.audioEntries = library.audioEntries.Concat(_audioEntries).ToArray(); + + foreach (var entry in _audioEntries) + { + try + { + library.audioEntries = library.audioEntries.Append(entry).ToArray(); + } + catch(Exception ex) + { + Logger.LogError($"Couldn't add audio entry {entry.clips[0].name} to libary: {ex}"); + } + } Locator.GetAudioManager()._audioLibraryDict = library.BuildAudioEntryDictionary(); }