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

Exit addEarplugs if earplugs are used #1759

Merged
merged 3 commits into from
Jul 1, 2015
Merged

Exit addEarplugs if earplugs are used #1759

merged 3 commits into from
Jul 1, 2015

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Jun 28, 2015

This solves duplicating Earplugs in persistence scenarios (eg. persistence mods). It will still add the earplugs if none are equipped, but in terms of persistence you would normally equip them and be done with it anyways.


_unit = _this select 0;
// Exit if soldier has earplugs already in (persistence scenarios)
if (FUNC(hasEarPlugsIn)) exitWith {};
Copy link
Contributor

Choose a reason for hiding this comment

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

"Error if: Type code, expected Bool"
probably should be:
if ([_unit] call FUNC(hasEarPlugsIn)) exitWith {};

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh crap, forgot to commit after fixing that! 😁

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Jun 28, 2015
@alganthe
Copy link
Contributor

wouldn't removing earplugs on respawn be a better solution ?

@jonpas
Copy link
Member Author

jonpas commented Jun 29, 2015

wouldn't removing earplugs on respawn be a better solution ?

You mean by a mission/persistence system used? Yes of course, but this is not the only point of the PR. Right now if you have earplugs in already it will add another, which you'd normally just throw on the ground.

@jonpas
Copy link
Member Author

jonpas commented Jun 29, 2015

Would it be ok to add an ACE_Settings setting to disable that automatic addition?

@nicolasbadano
Copy link
Contributor

@jonpas, please resolve the conflict generated by #1763. Besides that I think this is ready to be merged.

Conflicts:
	addons/hearing/functions/fnc_addEarPlugs.sqf
@jonpas
Copy link
Member Author

jonpas commented Jul 1, 2015

Resolved conflicts and combined both PRs for performance.

nicolasbadano added a commit that referenced this pull request Jul 1, 2015
Exit addEarplugs if earplugs are used
@nicolasbadano nicolasbadano merged commit e01ff79 into acemod:master Jul 1, 2015
@nicolasbadano
Copy link
Contributor

Thanks!

@jonpas jonpas deleted the addEarplugsEnhancement branch July 1, 2015 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants