Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastroping - End descent with weapon holstered #10695

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ 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 {};
mrschick marked this conversation as resolved.
Show resolved Hide resolved
_unit selectWeapon _weapon;
}, [_unit, _currentWeapon], 2] call CBA_fnc_waitAndExecute;
};

[_pfhHandle] call CBA_fnc_removePerFrameHandler;
};

Expand Down