Skip to content

Commit

Permalink
Fix fastropes being blocked after rope breaking (#6239)
Browse files Browse the repository at this point in the history
* add broken state

* add broke state

* add broken state

* add broken state

* add broken state
  • Loading branch information
shukari authored and PabstMirror committed Apr 12, 2018
1 parent b7942fd commit 468da8b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_canFastRope.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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})
4 changes: 2 additions & 2 deletions addons/fastroping/functions/fnc_deployRopes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_fastRope.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_fastRopeServerPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_onRopeBreak.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 468da8b

Please sign in to comment.