diff --git a/CHANGELOG.md b/CHANGELOG.md index be5bae6..a13d801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## MuzikaGromche 13.37.1337 - Added LobbyCompatibility to dependencies to avoid desync issues. +- Fixed lyrics not being displayed in some situations. ## MuzikaGromche 13.37.911 - Sri Lanka Bus hotfix diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index 20c36cc..f13b16b 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -496,6 +496,9 @@ namespace MuzikaGromche SetLightColor(Color.white); } + // Max audible distance for AudioSource and LyricsEvent + public const float AudioMaxDistance = 150; + public static bool LocalPlayerCanHearMusic(EnemyAI jester) { var player = GameNetworkManager.Instance.localPlayerController; @@ -504,7 +507,7 @@ namespace MuzikaGromche return false; } var distance = Vector3.Distance(player.transform.position, jester.transform.position); - return distance < jester.creatureVoice.maxDistance; + return distance <= AudioMaxDistance; } private void Awake() @@ -1803,7 +1806,7 @@ namespace MuzikaGromche __instance.popUpTimer = Plugin.CurrentTrack.WindUpTimer; // Override popGoesTheWeaselTheme with Start audio - __instance.farAudio.maxDistance = 150; + __instance.farAudio.maxDistance = Plugin.AudioMaxDistance; __instance.farAudio.clip = Plugin.CurrentTrack.LoadedStart; __instance.farAudio.loop = false; if (Config.ShouldSkipWindingPhase) @@ -1838,7 +1841,7 @@ namespace MuzikaGromche // Override screamingSFX with Loop, delayed by the remaining time of the Start audio __instance.creatureVoice.Stop(); - __instance.creatureVoice.maxDistance = 150; + __instance.creatureVoice.maxDistance = Plugin.AudioMaxDistance; __instance.creatureVoice.clip = Plugin.CurrentTrack.LoadedLoop; __instance.creatureVoice.PlayDelayed(delay);