From e7807c009f301f835a98d00b981aee32e8e3033a Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 21:28:18 +0200 Subject: [PATCH] Use playerInventoryChanged instead of Take This makes sure to also fire when other mods, like TFAR (when adding backpacks) add items via script. --- addons/medical/CfgEventHandlers.hpp | 8 -------- addons/medical/XEH_postInit.sqf | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp index bf96b6a239..2fe5d0a9e5 100644 --- a/addons/medical/CfgEventHandlers.hpp +++ b/addons/medical/CfgEventHandlers.hpp @@ -47,11 +47,3 @@ class Extended_Local_EventHandlers { }; }; }; - -class Extended_Take_EventHandlers { - class CAManBase { - class ADDON { - take = QUOTE(call FUNC(itemCheck)); - }; - }; -}; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1b0a38f1af..f5cd793b13 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -266,3 +266,8 @@ if (USE_WOUND_EVENT_SYNC) then { // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly ["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); + +// Item Event Handler +["playerInventoryChanged", { + [ACE_player] call FUNC(itemCheck); +}] call EFUNC(common,addEventHandler);