Skip to content

Commit

Permalink
Hide earplug actions if setting disabled (#4913)
Browse files Browse the repository at this point in the history
* Hide earplug actions if setting disabled

* Add lines that are new
  • Loading branch information
PabstMirror authored Feb 16, 2017
1 parent 19d5fa0 commit 9d12815
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/hearing/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_Equipment {
class ACE_PutInEarplugs {
displayName = CSTRING(EarPlugs_On);
condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} );
condition = QUOTE(GVAR(EnableCombatDeafness) && {!([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player}});
exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
showDisabled = 0;
Expand All @@ -14,7 +14,7 @@ class CfgVehicles {
};
class ACE_RemoveEarplugs {
displayName = CSTRING(EarPlugs_Off);
condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) );
condition = QUOTE( GVAR(EnableCombatDeafness) && {[_player] call FUNC(hasEarPlugsIn)});
exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE( [_player] call FUNC(removeEarPlugs) );
showDisabled = 0;
Expand Down
2 changes: 2 additions & 0 deletions addons/hearing/functions/fnc_putInEarplugs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

params ["_player"];

if (!GVAR(EnableCombatDeafness)) exitWith {};

// Plugs in inventory, putting them in
_player removeItem "ACE_EarPlugs";

Expand Down
2 changes: 2 additions & 0 deletions addons/hearing/functions/fnc_removeEarplugs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

params ["_player"];

if (!GVAR(EnableCombatDeafness)) exitWith {};

if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full
[localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured);
};
Expand Down

0 comments on commit 9d12815

Please sign in to comment.