diff --git a/FullAuto.cs b/FullAuto.cs index 36c7a03..6f8b9c1 100644 --- a/FullAuto.cs +++ b/FullAuto.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.IO; using HarmonyLib; @@ -53,7 +54,7 @@ public class FullAuto : SonsMod if (!CheckFireInputPatch.HoldingGun) CheckFireInputPatch.RestoreReloadSpeed(); - if (!Enabled || !GameState.IsPlayerControllable || !CheckFireInputPatch.HoldingGun) + if (!Enabled || !CheckFireInputPatch.InGame || !CheckFireInputPatch.HoldingGun) return; if (Input.GetMouseButtonDown(2)) @@ -232,6 +233,8 @@ internal static class CheckFireInputPatch internal static bool HoldingGun => _lastGunTime >= 0f && Time.time - _lastGunTime < 0.25f; + internal static bool InGame => GameState.IsPlayerControllable && !Cursor.visible && !LocalPlayer.IsInInventory && Time.timeScale > 0f; + internal static void CancelBurst() { _burstLeft = 0; @@ -387,7 +390,7 @@ internal static class CheckFireInputPatch return; _triggerDown = true; - if (FullAuto.Enabled && FullAuto.Mode == FireMode.Burst && HoldingGun && GameState.IsPlayerControllable) + if (FullAuto.Enabled && FullAuto.Mode == FireMode.Burst && HoldingGun && InGame) StartBurst(); return; } @@ -446,7 +449,7 @@ internal static class CheckFireInputPatch var pressed = FirePressed(); var held = _triggerDown || pressed; - if (!GameState.IsPlayerControllable) + if (!InGame) { _burstLeft = 0; return !held; @@ -554,5 +557,4 @@ internal static class CheckFireInputPatch RLog.Msg($"FullAuto {name}: {(allowed ? "full-auto" : "ignored")}"); return allowed; } -} - +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index cb5d35a..14a6448 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "FullAuto", "name": "FullAuto", "author": "JustinOros", - "version": "1.1.0", + "version": "1.2.0", "description": "Hold fire to shoot any gun full-auto at a configurable rate", "gameVersion": "1.0.0", "platform": "Client",