diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index a96cf7af88..7ea3b1e1f9 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -43,3 +43,19 @@ class Extended_Respawn_EventHandlers { }; }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class GVAR(dropObject) { + Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); + }; + }; +}; + +class Extended_GetIn_EventHandlers { + class CAManBase { + class GVAR(dropObject) { + GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); + }; + }; +}; diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf index a5cea92a9b..c8c66ab7b3 100644 --- a/addons/common/functions/fnc_carryObj.sqf +++ b/addons/common/functions/fnc_carryObj.sqf @@ -36,12 +36,9 @@ if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) _to attachTo [_unit,(_this select 2)]; [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); }; - } else { - [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call FUNC(debug); }; - - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); - + // ["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); + ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; }; } else { if (!isNull ([_unit] call FUNC(getCarriedObj))) then { @@ -59,13 +56,14 @@ if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; _carriedObj setPosASL _positionUnit; }; - [[_unit, _carriedObj],"carryObjectDropped"] call FUNC(raiseScriptedEvent_f); [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); _unit setvariable [QGVAR(carriedObj),_to,true]; _return = true; - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + // ["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); + ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; + }; }; } else { diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 65edb41094..dfb5ba7dd1 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -9,8 +9,8 @@ */ #include "script_component.hpp" -#define DEFAULT_LOGGING_LEVEL -1 -#define DEFAULT_TEXT_DISPLAY -1 +#define DEFAULT_LOGGING_LEVEL 4 +#define DEFAULT_TEXT_DISPLAY 4 private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; _msg = _this select 0;