ACE3/addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf

23 lines
434 B
Plaintext
Raw Normal View History

/*
* Author: commy2
*
* Returns the unit that has the given backpack object equipped.
*
* Argument:
* 0: A backpack object (Object)
*
* Return value:
* Unit that has the backpack equipped. (Object)
*/
2015-01-18 06:56:09 +00:00
#include "script_component.hpp"
private ["_backpack", "_unit"];
_backpack = _this select 0;
_unit = objNull;
{
2015-01-18 06:56:09 +00:00
if (backpackContainer _x == _backpack) exitWith {_unit = _x};
} forEach (allUnits + allDeadMen);
_unit