Skip to content

Commit

Permalink
Common - Updated CBA_fnc_removeBinocularMagazine (#1556)
Browse files Browse the repository at this point in the history
* Update fnc_removeBinocularMagazine.sqf

* Update fnc_removeBinocularMagazine.sqf

* Update fnc_removeBinocularMagazine.sqf
  • Loading branch information
johnb432 committed Jun 24, 2023
1 parent 4ee49d4 commit 5c64f10
Showing 1 changed file with 4 additions and 9 deletions.
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);

0 comments on commit 5c64f10

Please sign in to comment.