From 80ff709676c0e9ddd25992edde1e578523417686 Mon Sep 17 00:00:00 2001 From: Salluci <69561145+Salluci@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:46:24 -0300 Subject: [PATCH] Redoing this --- addons/medical_feedback/XEH_postInit.sqf | 4 ++++ addons/medical_feedback/functions/fnc_effectHeartBeat.sqf | 4 ++++ addons/medical_feedback/functions/fnc_handleEffects.sqf | 1 + 3 files changed, 9 insertions(+) diff --git a/addons/medical_feedback/XEH_postInit.sqf b/addons/medical_feedback/XEH_postInit.sqf index 60dae8f04e..d9c5cc36cd 100644 --- a/addons/medical_feedback/XEH_postInit.sqf +++ b/addons/medical_feedback/XEH_postInit.sqf @@ -63,6 +63,10 @@ GVAR(bloodTickCounter) = 0; [true, _unit] call EFUNC(common,setVolume); [QUOTE(ADDON), 1, false] call EFUNC(common,setHearingCapability); + + //Force stop heart beat effect + GVAR(heartBeatEffectRunning) = false; + }] call CBA_fnc_addEventHandler; // Update effects to match new unit's current status (this also handles respawn) diff --git a/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf b/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf index 6156adb4f6..ea1f7455db 100644 --- a/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf +++ b/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf @@ -17,6 +17,10 @@ private _heartRate = GET_HEART_RATE(ACE_player); +if (!GVAR(heartBeatEffectRunning)) exitWith { + TRACE_1("Ending heart beat effect - force stopped",_heartRate); +}; + if (_heartRate == 0) exitWith { TRACE_1("Ending heart beat effect - zero",_heartRate); GVAR(heartBeatEffectRunning) = false; diff --git a/addons/medical_feedback/functions/fnc_handleEffects.sqf b/addons/medical_feedback/functions/fnc_handleEffects.sqf index 77c8d9f1ae..469fe0b16d 100644 --- a/addons/medical_feedback/functions/fnc_handleEffects.sqf +++ b/addons/medical_feedback/functions/fnc_handleEffects.sqf @@ -23,6 +23,7 @@ if (EGVAR(common,OldIsCamera) || {!alive ACE_player}) exitWith { [false] call FUNC(effectBloodVolume); [false] call FUNC(effectBloodVolumeIcon); [false] call FUNC(effectBleeding); + GVAR(heartBeatEffectRunning) = false; }; BEGIN_COUNTER(handleEffects);