2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-09-16 21:01:01 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Cut deployed ropes.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: A helicopter with deployed ropes <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-12-14 20:50:56 +00:00
|
|
|
* [_vehicle] call ace_fastroping_fnc_cutRopes
|
2015-09-16 21:01:01 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_vehicle"];
|
|
|
|
|
2017-09-19 20:38:49 +00:00
|
|
|
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
|
2015-09-16 21:01:01 +00:00
|
|
|
{
|
2016-02-21 23:29:15 +00:00
|
|
|
_x params ["", "_ropeTop", "_ropeBottom", "_dummy", "_hook", "_occupied"];
|
2015-09-16 21:01:01 +00:00
|
|
|
|
2015-12-22 07:53:57 +00:00
|
|
|
//Make player fall if rope is occupied
|
|
|
|
if (_occupied) then {
|
|
|
|
private _attachedObjects = attachedObjects _dummy;
|
|
|
|
//Rope is considered occupied when it's broken as well, so check if array is empty
|
|
|
|
//Note: ropes are not considered attached objects by Arma
|
2021-02-27 17:05:05 +00:00
|
|
|
if (_attachedObjects isNotEqualTo []) then {
|
2015-12-22 07:53:57 +00:00
|
|
|
detach ((attachedObjects _dummy) select 0);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-03-17 23:16:31 +00:00
|
|
|
//Destroy rope
|
|
|
|
//Only delete the hook first so the rope falls down.
|
|
|
|
//Note: ropeDetach was used here before, but the command seems a bit broken.
|
|
|
|
deleteVehicle _hook;
|
2016-05-22 13:27:24 +00:00
|
|
|
[{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute;
|
2015-09-16 21:01:01 +00:00
|
|
|
} count _deployedRopes;
|
|
|
|
|
|
|
|
_vehicle setVariable [QGVAR(deployedRopes), [], true];
|
2018-09-26 11:56:50 +00:00
|
|
|
|
|
|
|
// Set new state (0 if no FRIES, 2 if FRIES for manual stowing)
|
2021-02-18 18:58:08 +00:00
|
|
|
private _newState = [0, 2] select (isText (configOf _vehicle >> QGVAR(onCut)));
|
2018-09-26 11:56:50 +00:00
|
|
|
_vehicle setVariable [QGVAR(deploymentStage), _newState, true];
|