Skip to content

Common - Optimize and expand CBA_fnc_addWeaponWithoutItems#1557

Merged
jonpas merged 5 commits intoCBATeam:masterfrom
johnb432:addWeaponWithoutItems
Sep 7, 2023
Merged

Common - Optimize and expand CBA_fnc_addWeaponWithoutItems#1557
jonpas merged 5 commits intoCBATeam:masterfrom
johnb432:addWeaponWithoutItems

Conversation

@johnb432
Copy link
Copy Markdown
Contributor

@johnb432 johnb432 commented Sep 16, 2022

When merged this pull request will:

  • Uses 2.02 & 2.10 commands (removeAllSecondaryWeaponItems and compatibleMagazines)
  • Adds a new argument, which allows the user to keep the linked attachments on the gun. Default behavior is to remove them, just as the function did before.

I can understand if the 2nd change is not wanted and considered to go against the rules.
Despite that, I think it has it's uses - being able to spawn in a weapon (with attachments or not) without it consuming a magazine from the inventory is really nice.

If it's not wanted, I'll just all related changes, but keep the updated commands (compatibleMagazines is about 4x faster than CBA_fnc_compatibleMagazines).

Comment thread addons/common/fnc_addWeaponWithoutItems.sqf Outdated
@commy2
Copy link
Copy Markdown
Contributor

commy2 commented Sep 16, 2022

See: #1558 (comment)

@johnb432
Copy link
Copy Markdown
Contributor Author

See: #1558 (comment)

Would this PR be accepted, if compatibleMagazines would be reverted back to CBA_fnc_compatibleMagazines?

@johnb432
Copy link
Copy Markdown
Contributor Author

I reverted the changing of CBA_fnc_compatibleMagazines for compatibleMagazines, as that seemed to be a point that couldn't be agreed upon.

@jonpas jonpas changed the title Common - Updated & expanded CBA_fnc_addWeaponWithoutItems Common - Optimize and expand CBA_fnc_addWeaponWithoutItems Sep 6, 2023
@jonpas jonpas added this to the 3.16.0 milestone Sep 6, 2023
@jonpas jonpas merged commit 154a243 into CBATeam:master Sep 7, 2023
@johnb432 johnb432 deleted the addWeaponWithoutItems branch April 3, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants