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

fix: regression introduced with magazine reload fix #6176

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

usagirei
Copy link
Contributor

Purpose of change (The Why)

Went to look back at what broke the mag reloading in the first place, it was introduced with #4817

#6174 partially reintroduced the issue, but in the form of you could then potentially load unsupported ammo into an empty magazine already inside a gun (300 Blackout on a STANAG on an AR-15)

Describe the solution (The How)

This should solve that by further checking if the item being reloaded is a magazine, that is contained on a gun/mod that doesn't support said ammunition.

Describe alternatives you've considered

N/A

Testing

Vanilla:

  • Spawn AR-15, Mags, 556 and 300blk ammo
  • Can insert 300blk ammo on an empty mag
  • Mag with 300blk can't be inserted in AR-15
  • Insert empty mag on AR-15
  • Can't load the empty mag with 300blk any longer
  • Add underslug shotgun or M203
  • Reloading still shows up shot/grenades as potential ammo to reload

Modded:

  • Attach MWPE Six12 underslug shotgun (magazine fed)
  • Loose shot and magazines can be loaded as usual

Additional context

image

Should there be another check if the parent item is a gun / gunmod, instead of just checking if the magazine has a parent_item()?
Since we don't have pockets on BN, i couldn't imagine a situation where that would not be the case.

Checklist

Mandatory

@github-actions github-actions bot added the src changes related to source code. label Mar 10, 2025
Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awawa

@chaosvolt chaosvolt merged commit f7d1552 into cataclysmbnteam:main Mar 10, 2025
16 checks passed
@usagirei usagirei deleted the mag_reload_regr branch March 10, 2025 17:16
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.

2 participants