fix: wielded weapon show correct ammocount when selecting gunmod, default firemode name for gunmods #4183
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.
Purpose of change
This helps make it a bit more visible when your wielded weapon is currently set to fire an attached gunmod, because it's easy to look at the wield query after flipping past full-auto, forgetting that the next fire mode is an M203 and not returning to semi-auto, and oops I exploded again.
Describe the solution
fmt_wielded_weapon
so that the ammo counter for the currently wielded weapon actually matches the ammo count of the current fire mode used, meaning the number of shots shown will properly change when you switch from a gun's normal firing modes to any attached gunmods.defmode_name
so that gunmods will generate a default fire mode name telling you at a glance that the selected fire mode has you switched to a gunmod. This can of course be override by any gunmods that define their own fire modes, such as with bayonets.Describe alternatives you've considered
n/a
instead of zero when a bayonet is selected.Testing
gunmod
bayonet
instead ofgunmod
since not a default fire mode name.Additional context
Having stuff like more than one shootable gunmod installed (like an M203 and a rail-mounted crossbow for example) can still potentially confuse the player since chances are they'll both show as
(1) [gunmod] etcetc
but it's still more information than the player got previously. :3Checklist