Skip to content

Commit

Permalink
Fastroping - End descent with weapon holstered (#10695)
Browse files Browse the repository at this point in the history
* Holster Weapon after Fast Roping

* Unholster previously selected weapon 2s after holstering

* Abort on unconscious fastroper

Co-authored-by: PabstMirror <[email protected]>

---------

Co-authored-by: PabstMirror <[email protected]>
  • Loading branch information
mrschick and PabstMirror authored Feb 4, 2025
1 parent bc569e8 commit 493dd39
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ if (isNull attachedTo _unit) exitWith {
playSound QGVAR(Thud);
};

// Holster weapon if one is being held, then unholster it again
private _currentWeapon = currentWeapon _unit;
if (_currentWeapon != "") then {
[_unit] call EFUNC(weaponselect,putWeaponAway);
[{
params ["_unit", "_weapon"];
// Abort if the unit already selected a different weapon
if (currentWeapon _unit != "") exitWith {};
if (!([_unit] call EFUNC(common,isAwake))) exitWith {};
_unit selectWeapon _weapon;
}, [_unit, _currentWeapon], 2] call CBA_fnc_waitAndExecute;
};

[_pfhHandle] call CBA_fnc_removePerFrameHandler;
};

Expand Down

0 comments on commit 493dd39

Please sign in to comment.