using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using HarmonyLib; using OtherLoader; using UnityEngine; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace Volks.SR1MPistols; [BepInPlugin("Volks.SR1MPistols", "SR1MPistols", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class SR1MPistolsPlugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.SR1MPistols"); OtherLoader.RegisterDirectLoad(BasePath, "Volks.SR1MPistols", "", "", "sr1mvektorpistol", ""); } } internal class AutoReleaseOnMagLoad : MonoBehaviour { private FVRFireArm weapon; private Handgun handgun; private bool wasLoaded; public void Start() { weapon = ((Component)this).GetComponent(); if (!((Object)(object)weapon == (Object)null) && weapon is Handgun) { ref Handgun reference = ref handgun; FVRFireArm obj = weapon; reference = (Handgun)(object)((obj is Handgun) ? obj : null); } } public void FixedUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Invalid comparison between Unknown and I4 if ((Object)(object)handgun != (Object)null) { if ((Object)(object)weapon.Magazine != (Object)null) { if (weapon.Magazine.HasARound()) { if ((int)handgun.Slide.CurPos >= 2 && !wasLoaded) { handgun.Slide.ImpartFiringImpulse(); wasLoaded = true; } } else { wasLoaded = false; } } else { wasLoaded = false; } } else { wasLoaded = false; } } }