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

Common - Updated CBA_fnc_removeBinocularMagazine #1556

Merged
Merged
Changes from all 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
13 changes: 4 additions & 9 deletions addons/common/fnc_removeBinocularMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Function: CBA_fnc_removeBinocularMagazine
Description:
Removes the magazine of the units rangefinder.
Has to be executed on the machine where the unit is local.
Parameters:
_unit - A unit <OBJECT>
Expand All @@ -17,19 +19,12 @@ Examples:
(end)
Author:
commy2
commy2, johnb43
---------------------------------------------------------------------------- */
SCRIPT(removeBinocularMagazine);

params [["_unit", objNull, [objNull]]];

if (!local _unit) exitWith {};

private _binocular = binocular _unit;
private _selectBinocular = currentWeapon _unit isEqualTo _binocular;

_unit addWeapon _binocular;

if (_selectBinocular) then {
_unit selectWeapon _binocular;
};
_unit removeBinocularItem (_unit call CBA_fnc_binocularMagazine);