From a2093b931cbf362420980a69112f035ffc583b54 Mon Sep 17 00:00:00 2001 From: awsms <48278661+awsms@users.noreply.github.com> Date: Thu, 1 Oct 2026 07:49:58 +0200 Subject: [PATCH] Block aiming down sights during weapon reloads The shared ADS permission check excluded weapon switches, melee and offhand states but omitted the reload family. Holding or requesting ADS during a reload could therefore keep raising the weapon and zooming the view. Reject ADS throughout Reloading, ReloadingInterrupt, ReloadStart, ReloadStartInterrupt and ReloadEnd using the existing weapon-state helper. The normal ADS intent/fraction update then lowers the weapon at its ADS-out rate and prevents re-entry until the reload ends. The same permission check runs in authoritative simulation and client prediction, covering keyboard reload and controller use/reload without changing their bindings. Validation: play build, targeted rustfmt and diff checks passed. A temporary probe reproduced the permissive behavior with the previous implementation, then verified ADS exit and blocked entry for all five reload states with RELOAD and USE_RELOAD inputs. It also checked ADS recovery when ready and preserved firing/rechamber permissions. No in-game visual retest was run. --- crates/weapon_iw4/src/ads_allow.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/weapon_iw4/src/ads_allow.rs b/crates/weapon_iw4/src/ads_allow.rs index 0cb697f..d7cc680 100644 --- a/crates/weapon_iw4/src/ads_allow.rs +++ b/crates/weapon_iw4/src/ads_allow.rs @@ -38,6 +38,11 @@ pub fn is_ads_allowed( let ws = ps.weaponstate_primary; + // Reload start, magazine/shell insertion, interruption and end all leave ADS. + if crate::WeaponState::from_i32(ws).is_ok_and(crate::WeaponState::is_reload_family) { + return false; + } + if (0x10..=0x15).contains(&ws) { return false; }