From d9aab91f9757e471229ec844236ea7650f41bbd4 Mon Sep 17 00:00:00 2001 From: Zakant Date: Thu, 23 Mar 2017 13:26:06 +0100 Subject: [PATCH] Implemented cpr progress function --- .../functions/fnc_treatmentCPR_progress.sqf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf index 2b8136eb20..69c9a0d9fd 100644 --- a/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf @@ -15,3 +15,13 @@ * Public: No */ #include "script_component.hpp" +params ["_args", "_elapsedTime", "_totalTime"]; +_args params ["_caller", "_target"]; + +// If the patient awakes my mysterious force, no cpr is needed! +if(_target call EFUNC(common,isAwake)) exitWith {false}; +if(!(_target getVariable [QEGVAR(medical,inCardiacArrest), false])) exitWith {false}; + +[_target] call FUNC(calculateBlood); // Calculate blood volume. If their is no pulse, nothing happens! + +(alive _target) // CPR may only proceed if the patient is not dead