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

Disposable - Replace magazines in backpack when launcher fits backpacks #1485

Merged
merged 4 commits into from Dec 18, 2021

Conversation

10Dozen
Copy link
Contributor

@10Dozen 10Dozen commented Jul 27, 2021

When merged this pull request will:

@10Dozen 10Dozen changed the title Disposable - Add option to replace magazine to launcher in backpack Disposable - Add option to replace magazine with launcher in backpack Jul 27, 2021
Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

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

  1. No need to make a config entry for this, because it already is one with the "WeaponsSlotsInfo\allowedSlots" array.
  2. No need to maintain a list when we can abuse HashMaps as sets. Lookup in list is O(n) at worts, while lookup in set is O(1).

Disclaimer, suggestions not tested, so there may be typos or logic holes.

addons/disposable/XEH_preInit.sqf Outdated Show resolved Hide resolved
addons/disposable/XEH_preInit.sqf Outdated Show resolved Hide resolved
addons/disposable/XEH_preInit.sqf Outdated Show resolved Hide resolved
addons/disposable/fnc_replaceMagazineCargo.sqf Outdated Show resolved Hide resolved
@10Dozen
Copy link
Contributor Author

10Dozen commented Jul 27, 2021

commy2 is like: I'll never add this feature!
Also commy2: I rewrite every single line of the feature's PR!

>_<

@commy2
Copy link
Contributor

commy2 commented Jul 27, 2021

Such is life.

@commy2
Copy link
Contributor

commy2 commented Jul 27, 2021

lgtm

Did you test if it works?

@10Dozen
Copy link
Contributor Author

10Dozen commented Jul 27, 2021

Did you test if it works?

Yeah, works fine.

@10Dozen 10Dozen changed the title Disposable - Add option to replace magazine with launcher in backpack Disposable - Replace magazines in backpack when launcher fits backpacks Jul 27, 2021
@commy2
Copy link
Contributor

commy2 commented Jul 27, 2021

Should i change other lists/namespaces into hashMaps too?

I don't know. It seems not really necessary.

Co-authored-by: commy2 <commy-2@gmx.de>
@commy2 commy2 merged commit ac0895b into CBATeam:master Dec 18, 2021
@commy2
Copy link
Contributor

commy2 commented Dec 18, 2021

Good job :)

@commy2 commy2 added this to the 3.15.7 milestone Dec 18, 2021
@commy2 commy2 added the Feature label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants