From 910bb151e252d4c116b5603459194301d8d78aa9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Aug 2015 01:47:40 -0500 Subject: [PATCH] #1988 - Boost explosive hearing damage --- addons/hearing/CfgEventHandlers.hpp | 2 +- addons/hearing/functions/fnc_explosionNear.sqf | 8 ++++++-- addons/hearing/functions/fnc_moduleHearing.sqf | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index ce968ed2ca..f09f259266 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -29,7 +29,7 @@ class Extended_FiredNear_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class GVAR(ExplosionNear) { - clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; ); + clientExplosion = QUOTE(_this call FUNC(explosionNear);); }; }; }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 8cea263fec..7e4d0b9bfc 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -21,8 +21,12 @@ if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; params ["_unit", "_damage"]; +if (_unit != ACE_player) exitWith {}; + +TRACE_2("explosion near player",_unit,_damage); + private ["_strength"]; -_strength = 0 max _damage; +_strength = (0 max _damage) * 30; if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 035d5eaa88..2b4daecc72 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -9,9 +9,8 @@ * None */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);