ACE3/addons/dragging/functions/fnc_initObject.sqf
2016-01-28 12:52:53 -06:00

35 lines
898 B
Plaintext

/*
* Author: commy2
* Initialize variables for drag or carryable objects. Called from init EH.
*
* Argument:
* 0: Any object <OBJECT>
*
* Return Value:
* None
*
* Example:
* [box] call ace_dragging_fnc_initObject;
*
* Public: No
*/
#include "script_component.hpp"
params ["_object"];
private _config = configFile >> "CfgVehicles" >> typeOf _object;
if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
private _position = getArray (_config >> QGVAR(dragPosition));
private _direction = getNumber (_config >> QGVAR(dragDirection));
[_object, true, _position, _direction] call FUNC(setDraggable);
};
if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
private _position = getArray (_config >> QGVAR(carryPosition));
private _direction = getNumber (_config >> QGVAR(carryDirection));
[_object, true, _position, _direction] call FUNC(setCarryable);
};