Skip to content

Pistol fires twice per trigger pull (semi-auto not enforced) — regression since 3.0 #195

Description

@oscarsolerfollana

The Handgun/Pistol fires two rounds from a single click. A normal-length click (the ~100-150 ms a human holds the button) drains the clip from 10 to 8. It should fire one round per press, as the pistol is semi-auto (GetMustPressTriggerForEachShot() returns true).

Repro: join marines, select the pistol, fire single clicks — the clip drops by 2 each time.

Not an engine issue. Reproduced identically on GoldSrc (Steam, this 3.3b9 build) and on Xash3D-FWGS. And the classic 3.0 client dll (March 2005) fires one round per click correctly under the same engine, so this is a regression in the mod code introduced somewhere between 3.0 and 3.3b9, not an engine bug.

Where it seems to live: the semi-auto gate is m_fInAttack in AvHBasePlayerWeapon::ProcessValidAttack() (only valid if !GetMustPressTriggerForEachShot() || !m_fInAttack). PrimaryAttack() sets m_fInAttack = TRUE; WeaponIdle() clears it. The symptom means m_fInAttack is getting cleared mid-hold, so once the ROF cooldown elapses a second shot slips through before the button is released. Suspicious area: the manual timer bookkeeping in AvHBasePlayerWeapon::ItemPostFrame() (it decrements m_flNextPrimaryAttack and m_flTimeWeaponIdle by cmd.msec on top of the SDK's own ItemPostFrame handling). A git blame/diff of the weapon code against 3.0-3.1 should pinpoint the change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions