Skip to content

Fix weapon no-auto-switch flag always being applied to weapons without clips - #564

Open
arbabf wants to merge 3 commits into
mapbase-source:developfrom
arbabf:fix/override-clip-check
Open

arbabf wants to merge 3 commits into
mapbase-source:developfrom
arbabf:fix/override-clip-check

Conversation

@arbabf

@arbabf arbabf commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds a second check to CBaseCombatWeapon::Equip() to set the SF_WEAPON_NO_AUTO_SWITCH_WHEN_EMPTY spawnflag for weapons that don't use clips (e.g. grenades), but only if they have no ammo. This fixes an issue where the player doesn't automatically switch off of weapons that doesn't use clips, if they pick up a weapon, and expend all its ammo before holstering that weapon, which would otherwise clear this spawnflag. This was a particular issue with HL2DM and its mods, where frag use is prevalent.


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@arbabf arbabf changed the title Fix weapon auto-switch flag always being applied to weapons without clips Fix weapon no-auto-switch flag always being applied to weapons without clips Nov 20, 2026
arbabf and others added 2 commits November 21, 2026 13:11
Co-authored-by: Blixibon <acj3017@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants