/*
	FILE: fnc_fold.sqf

	Name: tbd_m119_m119_fnc_fold

	Author(s):
		ilbinek

	Description:
		Fold the M119

	Parameters:
		_arty	- object	- M119 to be folded

	Returns:
		Nothing
	
	Examples:
		> [_arty] call tbd_m119_m119_fnc_fold;

	Public:
		No
*/

#include "..\script_component.hpp"

params ["_arty"];

if !([_arty] call FUNC(canFold)) exitWith {};

_arty lock true;

// animate
private _curTur = _arty animationPhase "mainTurret";
private _curGun = _arty animationPhase "mainGun";

_arty animateSource ["plate_back_source", 0, true];
_arty animateSource ["plate_front_source", 1, true];
_arty animateSource ["mainTurretT_source", -_curTur];
_arty animateSource ["mainGunT_source", -_curGun + 0.1];
_arty animateSource ["hydraulicsT_source", -_curGun + 0.1];

_arty setVariable [QGVAR(folded), true, true];
_arty enableRopeAttach true;
