ACE3/addons/dragging/functions/fnc_initObject.sqf

35 lines
899 B
Plaintext
Raw Normal View History

/*
* Author: commy2
2015-03-17 14:42:25 +00:00
* Initialize variables for drag or carryable objects. Called from init EH.
*
2016-06-18 09:50:41 +00:00
* Arguments:
2015-08-09 12:53:13 +00:00
* 0: Any object <OBJECT>
*
2015-08-09 12:53:13 +00:00
* Return Value:
* None
*
2016-01-28 18:52:53 +00:00
* Example:
* [box] call ace_dragging_fnc_initObject;
*
2015-08-09 12:53:13 +00:00
* Public: No
*/
#include "script_component.hpp"
2015-08-09 12:53:13 +00:00
params ["_object"];
2016-01-28 18:52:53 +00:00
private _config = configFile >> "CfgVehicles" >> typeOf _object;
2015-03-17 14:42:25 +00:00
if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
2016-01-28 18:52:53 +00:00
private _position = getArray (_config >> QGVAR(dragPosition));
private _direction = getNumber (_config >> QGVAR(dragDirection));
[_object, true, _position, _direction] call FUNC(setDraggable);
};
2015-03-17 14:42:25 +00:00
2015-08-26 07:10:29 +00:00
if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
2016-01-28 18:52:53 +00:00
private _position = getArray (_config >> QGVAR(carryPosition));
private _direction = getNumber (_config >> QGVAR(carryDirection));
2015-03-17 14:42:25 +00:00
[_object, true, _position, _direction] call FUNC(setCarryable);
};