2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Returns the unit that has the given backpack object equipped.
|
2015-08-04 23:12:55 +00:00
|
|
|
*
|
2015-01-11 16:42:31 +00:00
|
|
|
* Argument:
|
2015-08-04 23:12:55 +00:00
|
|
|
* 0: Executing Unit (Object)
|
|
|
|
* 1: A backpack object (Object)
|
|
|
|
*
|
2015-01-11 16:42:31 +00:00
|
|
|
* Return value:
|
|
|
|
* Unit that has the backpack equipped. (Object)
|
|
|
|
*/
|
2015-01-18 06:56:09 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-04 23:12:55 +00:00
|
|
|
scopeName "main";
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-04 23:12:55 +00:00
|
|
|
params ["_unit","_backpack"];
|
|
|
|
_target = objNull;
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2015-08-04 23:12:55 +00:00
|
|
|
if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"};
|
|
|
|
} forEach nearestObjects [_unit, ["Man"],2];
|
|
|
|
_target
|