From 2f41fa01c8926f14593b3f4df3b1d6d18acc3fd6 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Sun, 20 Sep 2026 22:41:36 -0700 Subject: [PATCH] Auto reload keeps loading until the gun is full --- FullAuto.cs | 32 +++++++++++++++++++++++++++----- manifest.json | 2 +- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/FullAuto.cs b/FullAuto.cs index 29f11bc..37312f1 100644 --- a/FullAuto.cs +++ b/FullAuto.cs @@ -247,6 +247,7 @@ internal static class CheckFireInputPatch private const int BurstSize = 3; private const float ReleaseTime = 0.15f; private const float AutoReloadDelay = 0.2f; + private const float AutoReloadNextDelay = 0.05f; private static readonly Dictionary Guns = new() { @@ -283,6 +284,8 @@ internal static class CheckFireInputPatch private static readonly List Lights = new(); private static float _emptySince = -1f; private static float _nextReloadTry; + private static bool _autoReloading; + private static IntPtr _autoReloadGun = IntPtr.Zero; private static bool _loggedHook; internal static bool HoldingGun => _lastGunTime >= 0f && Time.time - _lastGunTime < 0.25f; @@ -347,7 +350,14 @@ internal static class CheckFireInputPatch private static void TryAutoReload(RangedWeaponController controller) { - if (!FullAuto.AutoReload || !InGame || controller._isReloading || controller.IsReloading() || controller.IsReloadQueued()) + if (!FullAuto.AutoReload || !InGame) + { + _emptySince = -1f; + _autoReloading = false; + return; + } + + if (controller._isReloading || controller.IsReloading() || controller.IsReloadQueued()) { _emptySince = -1f; return; @@ -358,7 +368,13 @@ internal static class CheckFireInputPatch return; var ammo = weapon.GetAmmo(); - if (ammo == null || !ammo.IsEmpty()) + if (ammo == null) + return; + + if (_autoReloading && (_autoReloadGun != controller.Pointer || ammo.IsFull() || FirePressed())) + _autoReloading = false; + + if (!ammo.IsEmpty() && !_autoReloading) { _emptySince = -1f; return; @@ -371,18 +387,24 @@ internal static class CheckFireInputPatch return; } - if (now - _emptySince < AutoReloadDelay || now < _nextReloadTry) + var wait = _autoReloading ? AutoReloadNextDelay : AutoReloadDelay; + if (now - _emptySince < wait || now < _nextReloadTry) return; - _nextReloadTry = now + 1f; + _nextReloadTry = now + 0.3f; if (!controller.CanReload()) + { + _autoReloading = false; return; + } controller.Reload(); + _autoReloading = true; + _autoReloadGun = controller.Pointer; if (FullAuto.Verbose) - RLog.Msg($"FullAuto auto reload {controller.GetIl2CppType().Name}"); + RLog.Msg($"FullAuto auto reload {controller.GetIl2CppType().Name}, ammo {ammo.GetRemainingAmmo()}/{ammo.GetCapacity()}"); } internal static void CancelBurst() diff --git a/manifest.json b/manifest.json index 0e86f3e..72df690 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "id": "FullAuto", "name": "FullAuto", "author": "JustinOros", - "version": "1.5.0", + "version": "1.5.1", "description": "Full-auto, semi-auto and 3-round burst for guns, with fast reload and a flashlight toggle", "gameVersion": "1.0.0", "platform": "Client",