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

Rearm - Fix some magazine types duplicating during rearm #7760

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

redbery
Copy link
Contributor

@redbery redbery commented Jun 14, 2020

When merged this pull request will:

  • Ensure all compatible magazine types for a turret are detected regardless of config implementation details
  • Prevent magazines being infinitely duplicated loading to server performance issues for specific magazine/turret configs

Some vehicles (issue discovered with the RHS's Bradley Busk III) report no compatible magazines when running CBA_fnc_compatibleMagazines without the allMuzzles parameter. This leads to the magazine type which will be added by the rearm action not getting removed before hand. Due to the code's assumption that all magazines have been removed, this leads to the filled magazines being added on top of the old (still loaded) magazines. Due to the old magazines still not being full the rearm option remains leading players to continuously duplicate the magazine count which for us has lead to server performance issues.

As the stated goal of the code is to find all allowed magazine classes in the weapon, it is expected that getting the magazines for all weapons should not lead to any issues other than a potential increased performance load for the specific setTurretMagazineAmmo function. All additional found magazine types due to this change should simply be removed and re-added as the comments state is intended by this function.

@mharis001 mharis001 added the kind/bug-fix Release Notes: **FIXED:** label Jun 14, 2020
@mharis001 mharis001 added this to the 3.13.3 milestone Jun 14, 2020
@PabstMirror PabstMirror merged commit 7da977a into acemod:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants