Skip to content

Commit

Permalink
Fixed harmony patching bug for FMOD in BZ
Browse files Browse the repository at this point in the history
  • Loading branch information
Metious committed Dec 24, 2024
1 parent d6bc4ab commit 5ddb280
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Nautilus/Patchers/CustomSoundPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,21 +778,14 @@ public static bool FMOD_CustomEmitter_Play_Prefix(FMOD_CustomEmitter __instance)

[HarmonyPatch(typeof(FMOD_CustomEmitter), nameof(FMOD_CustomEmitter.Stop))]
[HarmonyPrefix]
public static bool FMOD_CustomEmitter_Stop_Prefix(FMOD_CustomEmitter __instance, STOP_MODE stopMode)
public static bool FMOD_CustomEmitter_Stop_Prefix(FMOD_CustomEmitter __instance)
{
if (!EmitterPlayedChannels.TryGetValue(__instance.GetInstanceID(), out Channel channel))
{
return true;
}

if (stopMode == STOP_MODE.ALLOWFADEOUT)
{
TryFadeOutBeforeStop(channel);
}
else
{
channel.stop();
}
TryFadeOutBeforeStop(channel);

__instance._playing = false;
__instance.OnStop();
Expand Down

0 comments on commit 5ddb280

Please sign in to comment.