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: reloading magazine properly shows non-empty magazines with different, but compatible ammo #6174

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

usagirei
Copy link
Contributor

@usagirei usagirei commented Mar 10, 2025

Purpose of change (The Why)

Describe the solution (The How)

Magazine selection logic had a minor iteration oversight:
Instead of considering accepting a non-empty magazine if the contained ammunition matched any of the supported ammo types, the magazine was rejected it if it didn't match all of them,

Describe alternatives you've considered

Insert empty magazines in the weapon and magic-reload the rounds inside it without taking the magazine out.

Testing

Vanilla:

  • Loaded game, spawned 1911-460, and 3 mags, one empty, one with 460 and one with 45
  • Reloading works as expected with any given combination

Modded:

  • Tested with Modern Weapon Pack Extended SCAR-H, works as expected too.

Additional context

image

image

Checklist

Mandatory

@github-actions github-actions bot added the src changes related to source code. label Mar 10, 2025
@scarf005 scarf005 self-assigned this Mar 10, 2025
scarf005
scarf005 previously approved these changes Mar 10, 2025
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image

  1. spawned 1911-460, 3 m1911 magazines
  2. unloaded two, loaded one with .460 Rowlands
  3. attempted to reload 1911-460
  4. confirmed i could reload 3 magazines

seems to work on my machine.

@scarf005 scarf005 merged commit 354cd65 into cataclysmbnteam:main Mar 10, 2025
16 checks passed
@usagirei usagirei deleted the mag_reload branch March 10, 2025 12:26
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
2 participants