From 8be75b70a0ab5c457c8b0f0bc6e83793ebca37c4 Mon Sep 17 00:00:00 2001 From: Mark Ruffner Date: Thu, 28 Sep 2017 15:50:37 -0500 Subject: [PATCH 1/4] initial fix attempt --- addons/fastroping/functions/fnc_canCloseRamp.sqf | 2 +- addons/fastroping/functions/fnc_canCutRopes.sqf | 3 ++- addons/fastroping/functions/fnc_canFastRope.sqf | 2 +- addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/fastroping/functions/fnc_canCloseRamp.sqf b/addons/fastroping/functions/fnc_canCloseRamp.sqf index 58827cb29b8..253cb241b59 100644 --- a/addons/fastroping/functions/fnc_canCloseRamp.sqf +++ b/addons/fastroping/functions/fnc_canCloseRamp.sqf @@ -11,7 +11,7 @@ * Able to close ramp * * Example: - * [_player, _vehicle] call ace_fastroping_fnc_canCloseRamp + * [_vehicle, _door, _turretPaths] call ace_fastroping_fnc_canCloseRamp * * Public: No */ diff --git a/addons/fastroping/functions/fnc_canCutRopes.sqf b/addons/fastroping/functions/fnc_canCutRopes.sqf index 9775b155bb4..37a651c888f 100644 --- a/addons/fastroping/functions/fnc_canCutRopes.sqf +++ b/addons/fastroping/functions/fnc_canCutRopes.sqf @@ -19,4 +19,5 @@ params ["_vehicle"]; private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; -!(_deployedRopes isEqualTo []) +!(_deployedRopes isEqualTo []) && +{{!(_x select 5)} count (_deployedRopes) > 0} diff --git a/addons/fastroping/functions/fnc_canFastRope.sqf b/addons/fastroping/functions/fnc_canFastRope.sqf index 33c6bc28391..5bf5c07d03b 100644 --- a/addons/fastroping/functions/fnc_canFastRope.sqf +++ b/addons/fastroping/functions/fnc_canFastRope.sqf @@ -10,7 +10,7 @@ * Able to fast ropes * * Example: - * [_player, _vehicle] call ace_fastroping_fnc_canDeployRopes + * [_player, _vehicle] call ace_fastroping_fnc_canFastRope * * Public: No */ diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index 910d0147efa..dabb62a3c08 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -23,6 +23,11 @@ _rope params ["", "", "", "_dummy"]; //Wait until the unit is actually outside of the helicopter if (vehicle _unit != _unit) exitWith {}; +// dummy lost hook +if (isNull (attachedTo _dummy)) exitWith { + [_pfhHandle] call CBA_fnc_removePerFrameHandler; +}; + //Start fast roping if (animationState _unit != "ACE_FastRoping") exitWith { _unit disableCollisionWith _dummy; From 9cf42759fe6b0281b33f5e74f8d64ade3e7b4c5a Mon Sep 17 00:00:00 2001 From: Mark Ruffner Date: Thu, 28 Sep 2017 15:58:08 -0500 Subject: [PATCH 2/4] reset animation --- addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index dabb62a3c08..63d3d879cbd 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -25,6 +25,11 @@ if (vehicle _unit != _unit) exitWith {}; // dummy lost hook if (isNull (attachedTo _dummy)) exitWith { + TRACE_1("exit pfeh",_unit); + + [_unit, "", 2] call EFUNC(common,doAnimation); + _unit setVectorUp [0, 0, 1]; + [_pfhHandle] call CBA_fnc_removePerFrameHandler; }; From 3d7017f94f8112a5238932a8d84c43a3f914cbc8 Mon Sep 17 00:00:00 2001 From: Mark Ruffner Date: Thu, 28 Sep 2017 21:04:03 -0500 Subject: [PATCH 3/4] Fix logic --- addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index 63d3d879cbd..d7d49dd11ff 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -18,14 +18,14 @@ #include "script_component.hpp" params ["_arguments", "_pfhHandle"]; _arguments params ["_unit", "", "_rope", "", "_timeToPlayRopeSound"]; -_rope params ["", "", "", "_dummy"]; +_rope params ["", "", "", "_dummy", "_hook"]; //Wait until the unit is actually outside of the helicopter if (vehicle _unit != _unit) exitWith {}; // dummy lost hook -if (isNull (attachedTo _dummy)) exitWith { - TRACE_1("exit pfeh",_unit); +if (isNull _hook) exitWith { + TRACE_1("Hook lost, dropping and exiting pfeh",_unit); [_unit, "", 2] call EFUNC(common,doAnimation); _unit setVectorUp [0, 0, 1]; From 8e036721f9c7d6574de11613a9a8665ba025ae23 Mon Sep 17 00:00:00 2001 From: Mark Ruffner Date: Thu, 28 Sep 2017 23:06:20 -0500 Subject: [PATCH 4/4] Not cutting when roping --- addons/fastroping/functions/fnc_canCutRopes.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fastroping/functions/fnc_canCutRopes.sqf b/addons/fastroping/functions/fnc_canCutRopes.sqf index 37a651c888f..84239db671c 100644 --- a/addons/fastroping/functions/fnc_canCutRopes.sqf +++ b/addons/fastroping/functions/fnc_canCutRopes.sqf @@ -20,4 +20,4 @@ params ["_vehicle"]; private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; !(_deployedRopes isEqualTo []) && -{{!(_x select 5)} count (_deployedRopes) > 0} +{{(_x select 5)} count (_deployedRopes) == 0}