fix: empty underslung gun doesnt prevent going into firing mode UI #4292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this fix having an empty underbarrel mod/gun like the grenade launcher prevents the player from activating the firing ui via 'f'. This is especially troublesome as most players, including myself, only know how to change firing modes via this UI. This effectively prevents players from switching firing mode to the main weapon.
Purpose of change
This change allows the player to activate firing mode UI via 'f' in the case where the underslung gun/mod is out of ammo but the main gun still has ammo. This is especially confusing for most players as they are used to changing firing modes from this UI only.
Fixes #3966
Describe the solution
Solution simply checks if any of the gun modes of the current weapon ca be fired at the moment, not just the 'currently selected one'.
Describe alternatives you've considered
Testing
Spawn character with m4 carbine and m320 grenade launcher. Attach them together. switch to GLM and shoot it once. See that 'f' can still activate firing UI and you can switch firing modes from there and keep shooting the main gun.
Additional context
Checklist