Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display name of loaded ammo instead of ammo type (#51439) #2194

Merged
merged 2 commits into from
Dec 9, 2022

Conversation

KheirFerrum
Copy link
Collaborator

Summary

SUMMARY: Interface "Display name of loaded ammo instead of ammo type (#51439)"

Purpose of change

It's nice to know which one of my guns is loaded with FMJ or JHP so I can figure out which gun I should use on the armoured enemies

Describe the solution

Ports #51439.

Describe alternatives you've considered

  • Make it display the full name of the default ammo when it's not loaded.
    Much less useful, I'd prefer it tell me the ammo group usable for the gun rather than the specific default ammo it assumes.

Testing

Spawned multiple Barrett rifles and M1911, loaded them with different ammunition and checked that they displayed correctly. Unloaded all of them and checked that they still displayed ammo group as expected.

Additional context

Came across it while looking over the Proportional and Relative support PR

@github-actions github-actions bot added the src changes related to source code. label Nov 19, 2022
@olanti-p
Copy link
Contributor

olanti-p commented Dec 2, 2022

Bug: guns with different ammo stack, and when stacked it's implied that both guns are loaded with same ammo

Example

Wielded
image

Same guns, stashed in inventory
image

@KheirFerrum
Copy link
Collaborator Author

KheirFerrum commented Dec 2, 2022

Bug: guns with different ammo stack, and when stacked it's implied that both guns are loaded with same ammo

Crap, I'll look into what I should change for this and get it fixed in a bit.

Update: It appears to be specific to some guns. M4A1, Barrett, etc displays properly but the shotgun doesn't. On a hunch I've tested other guns without magazines. It consistently stacks regardless of contents if it doesn't use magazines

ammo_current returns itype_id::NULL_ID() if it doesn't have ammo and isn't ammo itself, so no worries with nullptrs.
@olanti-p olanti-p merged commit 46be12f into cataclysmbnteam:upload Dec 9, 2022
@KheirFerrum KheirFerrum deleted the Port-Ammo-Display branch December 12, 2022 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants