2015-03-14 12:51:23 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
2015-03-17 14:42:25 +00:00
|
|
|
* Initialize variables for drag or carryable objects. Called from init EH.
|
2015-03-14 12:51:23 +00:00
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Any object (Object)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* NONE.
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private "_object";
|
|
|
|
|
|
|
|
_object = _this select 0;
|
|
|
|
|
2015-03-17 14:42:25 +00:00
|
|
|
private "_config";
|
|
|
|
_config = configFile >> "CfgVehicles" >> typeOf _object;
|
|
|
|
|
|
|
|
if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
|
2015-03-14 12:51:23 +00:00
|
|
|
private ["_position", "_direction"];
|
|
|
|
|
2015-03-17 14:42:25 +00:00
|
|
|
_position = getArray (_config >> QGVAR(dragPosition));
|
|
|
|
_direction = getNumber (_config >> QGVAR(dragDirection));
|
2015-03-14 12:51:23 +00:00
|
|
|
|
|
|
|
[_object, true, _position, _direction] call FUNC(setDraggable);
|
|
|
|
};
|
2015-03-17 14:42:25 +00:00
|
|
|
|
|
|
|
if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
|
|
|
|
private ["_position", "_direction"];
|
|
|
|
|
|
|
|
_position = getArray (_config >> QGVAR(carryPosition));
|
|
|
|
_direction = getNumber (_config >> QGVAR(carryDirection));
|
|
|
|
|
|
|
|
[_object, true, _position, _direction] call FUNC(setCarryable);
|
|
|
|
};
|