From 822bd22c977e80566697ce9eead4424dbba291fb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 20 Apr 2015 02:18:46 -0500 Subject: [PATCH] gj git --- addons/hearing/functions/fnc_firedNear.sqf | 11 ++++------- .../functions/fnc_updatePlayerVehAttenuation.sqf | 12 +++++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 7b50a44a14..6a603c3c3a 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -31,26 +31,23 @@ if (!GVAR(enableCombatDeafness)) exitWith {}; if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; if (_weapon in ["Throw", "Put"]) exitWith {}; -_vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttunation)}; +_vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; if (_distance < 1) then {_distance = 1;}; _silencer = switch (_weapon) do { -case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; -case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; -case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; + case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; + case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; + case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; default {""}; }; _audibleFireCoef = 1; -//_audibleFireTimeCoef = 1; if (_silencer != "") then { _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); - //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); }; _audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); -//_audibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFireTime"); _loudness = _audibleFireCoef * _audibleFire / 64; _strength = _vehAttenuation * (_loudness - (_loudness/50 * _distance)); // linear drop off diff --git a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf index 15f3121c38..a7285d5e2b 100644 --- a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf +++ b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf @@ -36,7 +36,18 @@ if (ACE_player != _vehicle) then { }; }; }; + _newAttenuation = switch (true) do { + case (_effectType == ""): {1}; + case (_effectType == "CarAttenuation"): {0.5}; + case (_effectType == "RHS_CarAttenuation"): {0.5}; + case (_effectType == "OpenCarAttenuation"): {1}; + case (_effectType == "TankAttenuation"): {0.1}; + case (_effectType == "HeliAttenuation"): {0.3}; + case (_effectType == "OpenHeliAttenuation"): {0.9}; + case (_effectType == "SemiOpenHeliAttenuation"): {0.6}; + case (_effectType == "HeliAttenuationGunner"): {0.85}; + case (_effectType == "HeliAttenuationRamp"): {0.85}; default {1}; }; }; @@ -44,4 +55,3 @@ if (ACE_player != _vehicle) then { TRACE_2("New vehicle attenuation",_vehicle,_newAttenuation); GVAR(playerVehAttenuation) = _newAttenuation; -