diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index 89e3017e8a..e7bf74e414 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -11,7 +11,7 @@ class Extended_PostInit_EventHandlers { class Extended_Killed_EventHandlers { class CAManBase { - GVAR(killedHandler) = QUOTE(_this call FUNC(onKilled)); + GVAR(killedHandler) = QUOTE(_this call FUNC(onIncapacitated)); }; }; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 373a53d3ba..2043a2a632 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -15,6 +15,16 @@ */ #include "script_component.hpp" +if (isServer) then { + //Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) + ["medical_onUnconscious", { + params ["_unit", "_isUnconscious"]; + if (!_isUnconscious) exitWith {}; + TRACE_1("Knocked Out, Doing Deadman", _unit); + [_unit] call FUNC(onIncapacitated); + }] call EFUNC(common,addEventHandler); +}; + if !(hasInterface) exitWith {}; GVAR(PlacedCount) = 0; diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index fc1b02e1bc..470cae661d 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -44,8 +44,8 @@ PREP(getSpeedDialExplosive); PREP(module); +PREP(onIncapacitated); PREP(onInventoryChanged); -PREP(onKilled); PREP(openTimerSetUI); diff --git a/addons/explosives/functions/fnc_onKilled.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf similarity index 100% rename from addons/explosives/functions/fnc_onKilled.sqf rename to addons/explosives/functions/fnc_onIncapacitated.sqf