diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf index 375fcd5f89..639bf74919 100644 --- a/addons/backpacks/XEH_postInit.sqf +++ b/addons/backpacks/XEH_postInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); +["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler); diff --git a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf index acc028d6d9..85f5966aa9 100644 --- a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf +++ b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf @@ -17,5 +17,6 @@ params ["_unit","_backpack"]; _target = objNull; { if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"}; -} forEach nearestObjects [_unit, ["Man"],2]; +} count nearestObjects [_unit, ["Man"], 5]; +if (isNull _target) exitWith {ACE_Player}; _target diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index b1d55f9ce6..3419d2ed38 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -11,9 +11,8 @@ */ #include "script_component.hpp" -private ["_backpack", "_config"]; - -_backpack = _this select 0; +private ["_config"]; +params ["_backpack"]; if (typeName _backpack == "OBJECT") then { _backpack = typeOf _backpack;