From 29f1c4ab8cee0a55b825152a6d0bdf3d25dd1915 Mon Sep 17 00:00:00 2001 From: josshmot Date: Fri, 4 Apr 2025 20:23:15 +1000 Subject: [PATCH] Moved an if statement to a more appropriate place --- NewHorizons/Components/NHGameOverManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Components/NHGameOverManager.cs b/NewHorizons/Components/NHGameOverManager.cs index 3fb7f560..467d3a66 100644 --- a/NewHorizons/Components/NHGameOverManager.cs +++ b/NewHorizons/Components/NHGameOverManager.cs @@ -129,11 +129,6 @@ namespace NewHorizons.Components LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack); break; case NHCreditsType.Custom: - // We can't load in custom music if an IModBehaviour cannot be provided. This should only happen if called via TryHijackDeathSequence(). - if (mod is null) - { - NHLogger.LogWarning("Credits called using TryHijackDeathSequence(), custom credits audio cannot not be loaded."); - } LoadCustomCreditsScene(gameOver, mod); break; default: @@ -165,6 +160,11 @@ namespace NewHorizons.Components { AudioUtilities.SetAudioClip(musicSource, gameOver.audio, mod); } + else + { + // We can't load in custom music if an IModBehaviour cannot be provided. This should only happen if called via TryHijackDeathSequence(). + NHLogger.LogWarning("Credits called using TryHijackDeathSequence(), custom credits audio cannot not be loaded."); + } musicSource.SetMaxVolume(gameOver.audioVolume); musicSource.loop = gameOver.audioLooping; musicSource.FadeIn(gameOver.audioFadeInLength);