0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:50:45 -05:00

No longer needed

This commit is contained in:
CWX 2024-07-08 14:48:35 +01:00
parent b62b9b2afe
commit b7f487bbb6
2 changed files with 0 additions and 39 deletions

View File

@ -1,38 +0,0 @@
using System.Reflection;
using SPT.Reflection.Patching;
using Comfort.Common;
using EFT;
using HarmonyLib;
using UnityEngine;
namespace SPT.SinglePlayer.Patches.RaidFix
{
/// <summary>
/// Fixes an issue with the visor toggle sound not following the player in offline raids
/// </summary>
public class PlayerToggleSoundFixPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(Player), nameof(Player.PlayToggleSound));
}
[PatchPrefix]
private static bool PatchPrefix(ref bool previousState, bool isOn, AudioClip toggleOn, AudioClip toggleOff, Player __instance)
{
// Don't change anything and execute original method if it's not the player that triggers the method
if (!__instance.IsYourPlayer)
{
return true;
}
if (previousState != isOn)
{
Singleton<BetterAudio>.Instance.PlayNonspatial(isOn ? toggleOn : toggleOff, BetterAudio.AudioSourceGroupType.Character);
}
previousState = isOn;
return false;
}
}
}

View File

@ -37,7 +37,6 @@ namespace SPT.SinglePlayer
new ExfilPointManagerPatch().Enable(); new ExfilPointManagerPatch().Enable();
new ScavEncyclopediaPatch().Enable(); new ScavEncyclopediaPatch().Enable();
new HideoutQuestIgnorePatch().Enable(); new HideoutQuestIgnorePatch().Enable();
new PlayerToggleSoundFixPatch().Enable();
new SpawnProcessNegativeValuePatch().Enable(); new SpawnProcessNegativeValuePatch().Enable();
new SpawnPmcPatch().Enable(); new SpawnPmcPatch().Enable();
new ScavProfileLoadPatch().Enable(); new ScavProfileLoadPatch().Enable();