Fix fastropes being blocked after rope breaking (#6239)

* add broken state

* add broke state

* add broken state

* add broken state

* add broken state
This commit is contained in:
shukari 2018-04-12 17:23:18 +02:00 committed by PabstMirror
parent b7942fdb83
commit 468da8b79b
5 changed files with 6 additions and 6 deletions

View File

@ -22,5 +22,5 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
((driver _vehicle != _unit) &&
{!(_deployedRopes isEqualTo [])} &&
{{!(_x select 5)} count (_deployedRopes) > 0} &&
{{!(_x select 5) && !(_x select 6)} count (_deployedRopes) > 0} &&
{getPos _vehicle select 2 > 2})

View File

@ -45,8 +45,8 @@ private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
//deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied
_deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false];
//deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied, broken
_deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false, false];
false
} count _ropeOrigins;

View File

@ -23,7 +23,7 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
private _usableRope = _deployedRopes select 0;
private _usableRopeIndex = 0;
{
if !(_x select 5) exitWith {
if (!(_x select 5) && !(_x select 6)) exitWith {
_usableRope = _x;
_usableRopeIndex = _forEachIndex;
};

View File

@ -85,7 +85,7 @@ if (
//Update deployedRopes array
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
_deployedRopes set [_ropeIndex, [_attachmentPoint, _ropeTop, _ropeBottom, _dummy, _hook, false]];
_deployedRopes set [_ropeIndex, [_attachmentPoint, _ropeTop, _ropeBottom, _dummy, _hook, false, false]];
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
[_pfhHandle] call CBA_fnc_removePerFrameHandler;

View File

@ -36,7 +36,7 @@ private _brokenRope = [];
_brokenRope = _x;
};
} forEach _deployedRopes;
_brokenRope set [5, true];
_brokenRope set [6, true];
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
private _unit = {