'Fix' race condition where rope is cut as someone mounts the rope (#5569)

* initial fix attempt

* reset animation

* Fix logic

* Not cutting when roping
This commit is contained in:
Mark Ruffner 2017-10-16 16:11:21 -05:00 committed by jonpas
parent 9c7b546e24
commit 7aae91be79
4 changed files with 15 additions and 4 deletions

View File

@ -11,7 +11,7 @@
* Able to close ramp <BOOL>
*
* Example:
* [_player, _vehicle] call ace_fastroping_fnc_canCloseRamp
* [_vehicle, _door, _turretPaths] call ace_fastroping_fnc_canCloseRamp
*
* Public: No
*/

View File

@ -19,4 +19,5 @@ params ["_vehicle"];
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
!(_deployedRopes isEqualTo [])
!(_deployedRopes isEqualTo []) &&
{{(_x select 5)} count (_deployedRopes) == 0}

View File

@ -10,7 +10,7 @@
* Able to fast ropes <BOOL>
*
* Example:
* [_player, _vehicle] call ace_fastroping_fnc_canDeployRopes
* [_player, _vehicle] call ace_fastroping_fnc_canFastRope
*
* Public: No
*/

View File

@ -18,11 +18,21 @@
#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 _hook) exitWith {
TRACE_1("Hook lost, dropping and exiting pfeh",_unit);
[_unit, "", 2] call EFUNC(common,doAnimation);
_unit setVectorUp [0, 0, 1];
[_pfhHandle] call CBA_fnc_removePerFrameHandler;
};
//Start fast roping
if (animationState _unit != "ACE_FastRoping") exitWith {
_unit disableCollisionWith _dummy;