From 323c564ee3ca4c55de1c28e6bbfcbd2ff1ecbe2d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 13 Apr 2019 14:55:25 -0500 Subject: [PATCH] Medical - add eh for setUnconscious helper func --- addons/medical/XEH_postInit.sqf | 2 ++ addons/medical/functions/fnc_setUnconscious.sqf | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 97b9ab09333..5dd19195e80 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -1,6 +1,8 @@ // #define DEBUG_MODE_FULL #include "script_component.hpp" +[QEGVAR(medical,setUnconscious), LINKFUNC(setUnconscious)] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; [missionNamespace, "ACE_setCustomAimCoef", QUOTE(ADDON), { diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index ab4f944f898..618432a5fcd 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -25,7 +25,7 @@ if !(EGVAR(common,settingsInitFinished)) exitWith { EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; }; -params ["_unit", ["_knockOut", true, [false]], ["_minWaitingTime", 0, [0]], ["_forcedWakup", false, [false]]]; +params [["_unit", objNull, [objNull]], ["_knockOut", true, [false]], ["_minWaitingTime", 0, [0]], ["_forcedWakup", false, [false]]]; TRACE_4("setUnconscious",_unit,_knockOut,_minWaitingTime,_forcedWakup); if ((isNull _unit) || {!alive _unit} || {!(_unit isKindOf "CAManBase")}) exitWith { @@ -34,7 +34,7 @@ if ((isNull _unit) || {!alive _unit} || {!(_unit isKindOf "CAManBase")}) exitWit }; if (!local _unit) exitWith { - [QEGVAR(medical,setUnconscious), [_unit, _knockOut], _unit] call CBA_fnc_targetEvent; + [QEGVAR(medical,setUnconscious), _this, _unit] call CBA_fnc_targetEvent; true };