Skip to content

CVar to prevent automatic switch to the weapon that's picked up while pressing the fire button(s)

Adam Kaminski requested to merge topic/default/noswitchonfire-cvar into branch/default

In the heat of a deathmatch or team-based PvP game, you might not want to automatically switch to the weapon you (accidentally) picked up if you're firing the weapon that you already have selected. Doing so can leave you vulnerable for a couple of seconds while you switch from one weapon to another, giving other players an easy opportunity to frag you. In spite of that, you might still want to automatically switch to that weapon while you're not in combat.

So, I added a new CVar, cl_noswitchonfire, that prevents you from automatically switching to the weapon you picked up if you're pressing the fire button(s). There are four possible options:

  • 0: The switch will always happen, whether or not you're pressing any of the fire buttons (default).
  • 1: The switch won't happen if you're pressing +attack.
  • 2: The switch won't happen if you're pressing +altattack (I included this for the sake of completion, but this can be useful for weapons with alt-fire capabilities).
  • 3: The switch won't happen if you're pressing either button.

This is inspired by a similar feature that exists in Odamex.

Merge request reports

Loading