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 case where loadout_addItems loses magazines #3154

Merged

Conversation

jaj22
Copy link

@jaj22 jaj22 commented Feb 17, 2024

What type of PR is this.

  1. Bug
  2. Change
  3. Enhancement

What have you changed and why?

loadout_addItems assumed that units have a backpack, and could dump large item batches into the void under certain conditions, for example if a batch fitted within uniform+vest but not in either individually. Could happen with marksman rifles, as 5x20rnd 7.62 mags is often too much for a vest, and marksmen don't use backpacks.

This PR fixes the problem by using the vest as the fallback container in the case where backpack max load is zero. This may mean that the vest is sometimes overfilled, but that's working as intended. It does the same with backpacks.

Please specify which Issue this PR Resolves.

closes #3153

Please verify the following and ensure all checks are completed.

  1. Have you loaded the mission in LAN host?
  2. Have you loaded the mission on a dedicated server?

Is further testing or are further changes required?

  1. No
  2. Yes (Please provide further detail below.)

Probably needs a run with various templates to see if anything weirder than expected turns up.

@jaj22 jaj22 added the Bug Something isn't working label Feb 17, 2024
@jaj22 jaj22 added this to the 3.6 milestone Feb 17, 2024
Copy link

@Bob-Murphy Bob-Murphy left a comment

Choose a reason for hiding this comment

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

lgtm

@Bob-Murphy Bob-Murphy merged commit 17799f6 into official-antistasi-community:unstable Mar 30, 2024
Copy link

@ante185 ante185 left a comment

Choose a reason for hiding this comment

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

lgtm
Replicated described issue, merged PR, tested, and issue was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: loadout_addItems may not add any primary magazines
3 participants