Skip to content

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

Merged
johnb432 merged 1 commit intomasterfrom
arsenal-grip-fix
Apr 3, 2024
Merged

Arsenal - Fix FUNC(baseAttachment) returning non-CBA item modes#9916
johnb432 merged 1 commit intomasterfrom
arsenal-grip-fix

Conversation

@johnb432
Copy link
Copy Markdown
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
Copy Markdown
Member

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Copy Markdown
Member

Pretty sure this is good enough, up to you.

@johnb432
Copy link
Copy Markdown
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
Copy Markdown
Member

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
@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