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

Arsenal - Fix FUNC(baseAttachment) returning non-CBA item modes #9916

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Apr 3, 2024

When merged this pull request will:

  • Title.
  • This assumes that each attachment that has valid entries redefines them.
  • Needs more testing. I tested with RHS, but I want more testing from others.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@johnb432 johnb432 added the kind/bug-fix Release Notes: **FIXED:** label Apr 3, 2024
@johnb432 johnb432 requested a review from LinkIsGrim April 3, 2024 20:29
@LinkIsGrim
Copy link
Contributor

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

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

Fix the thing

@johnb432
Copy link
Contributor Author

johnb432 commented Apr 3, 2024

https://github.com/CBATeam/CBA_A3/blob/master/addons/accessory/fnc_switchAttachment.sqf#L48-L53 CBA ignores inherited values, so can we

Do we want to adopt the same code as CBA then?

@LinkIsGrim
Copy link
Contributor

Pretty sure this is good enough, up to you.

@johnb432
Copy link
Contributor Author

johnb432 commented Apr 3, 2024

Pretty sure this is good enough, up to you.

My solution is quite a bit faster, but I'm not sure if they do the exact same thing.

@LinkIsGrim
Copy link
Contributor

Result is the same, configProperties with no inheritance will result in empty array which just breaks that loop, same as exiting if inheritsFrom is not the property itself (technically it could be the case that some attachments in the chain inherit and others don't while this just checks the first, but CBA doesn't support that, and we end up checking everything in the chain anyway due to how this is called)

@johnb432 johnb432 added this to the 3.17.1 milestone Apr 3, 2024
@johnb432 johnb432 merged commit a72b3a4 into master Apr 3, 2024
5 checks passed
@johnb432 johnb432 deleted the arsenal-grip-fix branch April 3, 2024 21:53
@johnb432 johnb432 mentioned this pull request Apr 6, 2024
LinkIsGrim pushed a commit that referenced this pull request Apr 7, 2024
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.

2 participants