From 9e5f52d161041df20c08df61c7a09dc25a2f886c Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Fri, 19 Feb 2016 12:33:49 -0300 Subject: [PATCH] Make units heavily affected by the blast turn away from the light. --- addons/grenades/functions/fnc_flashbangExplosionEH.sqf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index cf4f3a5ca6..21cd6063aa 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -54,6 +54,10 @@ _affected = _affected - [ACE_player]; _x setSkill (skill _x / 50); + if (_strength > 0.2) then { + _x setVectorDir ((getPosASL _x) vectorDiff _grenadePosASL); + }; + [{ params ["_unit"]; @@ -87,7 +91,6 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { }; _strength = _strength * _losCoefficient; - }; // Add ace_hearing ear ringing sound effect if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then { @@ -130,5 +133,9 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { GVAR(flashbangPPEffectCC) ppEffectEnable false; }, [], 17 * _strength] call EFUNC(common,waitAndExecute); }; + + if (_strength > 0.2) then { + ACE_player setVectorDir (_eyePos vectorDiff _grenadePosASL); + }; }; true