Few more privates

This commit is contained in:
PabstMirror 2016-01-20 17:19:08 -06:00
parent 82179636f3
commit be8afe507c
3 changed files with 7 additions and 7 deletions

View File

@ -28,11 +28,12 @@ if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
//headgear hearing protection //headgear hearing protection
if(headgear _unit != "") then { if(headgear _unit != "") then {
private ["_protection"]; private _protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1;
_protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1;
if(_protection > 0) then { if(_protection > 0) then {
_strength = _strength * (1 - _protection); _strength = _strength * (1 - _protection);
}; };
}; };
TRACE_2("adding",_strength,GVAR(deafnessDV));
GVAR(deafnessDV) = GVAR(deafnessDV) + _strength; GVAR(deafnessDV) = GVAR(deafnessDV) + _strength;

View File

@ -97,4 +97,4 @@ TRACE_1("result",_strength);
if (_strength < 0.01) exitWith {}; if (_strength < 0.01) exitWith {};
// [{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute); [{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute);

View File

@ -1,6 +1,6 @@
/* /*
* Author: commy2 and esteldunedain and Ruthberg * Author: commy2 and esteldunedain and Ruthberg
* Updates and applys the current deafness. Called every 0.1 sec from a PFEH. * Updates and applys the current deafness. Called every 1 sec from a PFEH.
* *
* Arguments: * Arguments:
* 0: Args <ARRAY> * 0: Args <ARRAY>
@ -19,7 +19,6 @@
//Only run if deafness or ear ringing is enabled: //Only run if deafness or ear ringing is enabled:
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
private["_volume", "_soundTransitionTime"];
(_this select 0) params ["_justUpdateVolume"]; (_this select 0) params ["_justUpdateVolume"];
@ -71,7 +70,7 @@ if (!_justUpdateVolume) then {
if ((missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) || {!GVAR(enableCombatDeafness)}) exitWith {}; if ((missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) || {!GVAR(enableCombatDeafness)}) exitWith {};
_volume = GVAR(volume); private _volume = GVAR(volume);
// Earplugs reduce hearing 50% // Earplugs reduce hearing 50%
if ([ACE_player] call FUNC(hasEarPlugsIn)) then { if ([ACE_player] call FUNC(hasEarPlugsIn)) then {
@ -92,7 +91,7 @@ if (ACE_player getVariable ["ACE_isUnconscious", false]) then {
_volume = _volume min GVAR(UnconsciousnessVolume); _volume = _volume min GVAR(UnconsciousnessVolume);
}; };
_soundTransitionTime = if (_justUpdateVolume) then {0.1} else {1}; private _soundTransitionTime = if (_justUpdateVolume) then {0.1} else {1};
_soundTransitionTime fadeSound _volume; _soundTransitionTime fadeSound _volume;
_soundTransitionTime fadeSpeech _volume; _soundTransitionTime fadeSpeech _volume;