2015-01-16 23:21:47 +00:00
|
|
|
/**
|
|
|
|
* fn_setCarriedBy.sqf
|
|
|
|
* @Descr: Registers an object being carried by another object
|
|
|
|
* @Author: Glowbal
|
|
|
|
*
|
|
|
|
* @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT]
|
2015-01-18 19:09:19 +00:00
|
|
|
* @Return: BOOL True if succesfully registered
|
2015-01-16 23:21:47 +00:00
|
|
|
* @PublicAPI: false
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit","_to","_return"];
|
|
|
|
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
|
|
|
_to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
|
|
|
_return = false;
|
|
|
|
if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then {
|
2015-01-18 19:09:19 +00:00
|
|
|
_return = true;
|
|
|
|
_unit setvariable [QGVAR(carriedBy),_to,true];
|
2015-01-16 23:21:47 +00:00
|
|
|
};
|
|
|
|
_return
|