Skip to content

Commit

Permalink
Safer check for open in-game chapter panel / journal
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Mar 9, 2021
1 parent f90b025 commit 1ce17fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UI/InGameOverworldHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static void OnReloadLevel(On.Celeste.Mod.AssetReloadHelper.orig_ReloadLe

private static bool OnSetMusic(On.Celeste.Audio.orig_SetMusic orig, string path, bool startPlaying, bool allowFadeOut) {
// while the in-game chapter panel / journal is open, block all music changes except for muting it (which happens when entering a level).
if (path != null && overworldWrapper != null) {
if (path != null && overworldWrapper?.Scene == Engine.Scene) {
return false;
}

Expand All @@ -120,7 +120,7 @@ private static bool OnSetMusic(On.Celeste.Audio.orig_SetMusic orig, string path,

private static bool OnSetAmbience(On.Celeste.Audio.orig_SetAmbience orig, string path, bool startPlaying) {
// while the in-game chapter panel / journal is open, block all ambience changes except for muting it (which happens when entering a level).
if (path != null && overworldWrapper != null) {
if (path != null && overworldWrapper?.Scene == Engine.Scene) {
return false;
}

Expand Down

0 comments on commit 1ce17fe

Please sign in to comment.